CMake: Generate helptags during install step.

Fix #1056.
This commit is contained in:
Florian Walch 2014-08-22 18:40:12 +02:00 committed by John Szakmeister
parent 8b5f148b55
commit 1310820e4f
2 changed files with 17 additions and 1 deletions

View File

@ -177,7 +177,8 @@ if(BUSTED_PRG)
DEPENDS nvim-test unittest-headers)
endif()
install(DIRECTORY runtime DESTINATION share/nvim/)
install(DIRECTORY runtime DESTINATION share/nvim)
install(SCRIPT ${CMAKE_MODULE_PATH}/GenerateHelptags.cmake)
# Unfortunately, the below does not work under Ninja. Ninja doesn't use a
# pseudo-tty when launching processes, because it can put many jobs in parallel

View File

@ -0,0 +1,15 @@
message(STATUS "Generating helptags.")
execute_process(
COMMAND "${CMAKE_CURRENT_BINARY_DIR}/bin/nvim"
-u NONE
-esX
-c "helptags ++t ."
-c quit
WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/nvim/runtime/doc"
ERROR_VARIABLE err
RESULT_VARIABLE res)
if(NOT res EQUAL 0)
message(FATAL_ERROR "Generating helptags failed: ${err}")
endif()