Skip to content
forked from neovim/neovim

Commit

Permalink
cmake: runtime: use add_custom_command for tags directly (neovim#9430)
Browse files Browse the repository at this point in the history
This avoids generating the tags files all the time, and makes `make
install` with `CMAKE_INSTALL_MESSAGE=LAZY` much more silent in general.

Using `copy_if_different` instead of `remove` + `copy_directory` might
be good on top, but is a) not really necessary anymore and b) would not
sync removed files.
For this `file(COPY` could be used, but would require to re-run cmake on
changed input files then.
  • Loading branch information
blueyed authored and justinmk committed Jan 1, 2019
1 parent 3340e08 commit 24f2cc5
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,16 @@ foreach(PACKAGE ${PACKAGES})
file(GLOB "${PACKNAME}_DOC_FILES" ${PACKAGE}/doc/*.txt)
if(${PACKNAME}_DOC_FILES)
file(MAKE_DIRECTORY ${GENERATED_PACKAGE_DIR}/${PACKNAME})
add_custom_target("${PACKNAME}-tags"
add_custom_command(OUTPUT "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags"
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PACKAGE} ${GENERATED_PACKAGE_DIR}/${PACKNAME}
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
-u NONE -i NONE -e --headless -c "helptags doc" -c quit
DEPENDS
nvim
nvim_runtime_deps
WORKING_DIRECTORY "${GENERATED_PACKAGE_DIR}/${PACKNAME}"
)
add_dependencies(${PACKNAME}-tags nvim_runtime_deps)

add_custom_command(OUTPUT "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags"
DEPENDS
"${PACKNAME}-tags"
)

set("${PACKNAME}_DOC_NAMES")
foreach(DF "${${PACKNAME}_DOC_FILES}")
Expand All @@ -67,22 +62,18 @@ foreach(DF ${DOCFILES})
list(APPEND BUILDDOCFILES ${GENERATED_RUNTIME_DIR}/doc/${F})
endforeach()

add_custom_target(helptags
add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
COMMAND ${CMAKE_COMMAND} -E remove doc/*
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/runtime/doc doc
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
-u NONE -i NONE -e --headless -c "helptags ++t doc" -c quit
DEPENDS
nvim
nvim_runtime_deps
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}"
)
add_dependencies(helptags nvim_runtime_deps)

add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
DEPENDS
helptags
)

add_custom_target(doc_html
COMMAND make html
Expand Down

0 comments on commit 24f2cc5

Please sign in to comment.