2015-04-02 09:45:34 -07:00
|
|
|
set(SYN_VIM_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/genvimvim.lua)
|
|
|
|
set(GENERATED_RUNTIME_DIR ${PROJECT_BINARY_DIR}/runtime)
|
|
|
|
set(GENERATED_SYN_VIM ${GENERATED_RUNTIME_DIR}/syntax/vim/generated.vim)
|
|
|
|
set(GENERATED_HELP_TAGS ${GENERATED_RUNTIME_DIR}/doc/tags)
|
|
|
|
|
|
|
|
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR})
|
|
|
|
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax)
|
|
|
|
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax/vim)
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
|
|
|
|
COMMAND ${LUA_PRG} ${SYN_VIM_GENERATOR}
|
|
|
|
${PROJECT_SOURCE_DIR}/src/nvim ${GENERATED_SYN_VIM}
|
|
|
|
DEPENDS
|
|
|
|
${SYN_VIM_GENERATOR}
|
|
|
|
${PROJECT_SOURCE_DIR}/src/nvim/ex_cmds.lua
|
|
|
|
${PROJECT_SOURCE_DIR}/src/nvim/auevents.lua
|
|
|
|
${PROJECT_SOURCE_DIR}/src/nvim/options.lua
|
|
|
|
${PROJECT_SOURCE_DIR}/src/nvim/eval.c
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB DOCFILES ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
|
|
|
|
|
2015-07-26 03:39:34 -07:00
|
|
|
set(BUILDDOCFILES)
|
|
|
|
foreach(DF ${DOCFILES})
|
|
|
|
get_filename_component(F ${DF} NAME)
|
|
|
|
list(APPEND BUILDDOCFILES ${GENERATED_RUNTIME_DIR}/doc/${F})
|
|
|
|
endforeach()
|
|
|
|
|
2016-01-06 00:00:31 -07:00
|
|
|
add_custom_command(OUTPUT copy_docfiles
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2015-07-26 03:39:34 -07:00
|
|
|
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
|
2016-01-06 00:00:31 -07:00
|
|
|
)
|
2015-07-26 03:39:34 -07:00
|
|
|
|
2016-06-05 00:36:51 -07:00
|
|
|
add_custom_target(helptags
|
2015-04-02 09:45:34 -07:00
|
|
|
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
|
|
|
|
-u NONE
|
|
|
|
-i NONE
|
2016-02-10 05:21:16 -07:00
|
|
|
-e
|
2015-08-19 12:23:10 -07:00
|
|
|
--headless
|
2015-04-02 09:45:34 -07:00
|
|
|
-c "helptags ++t ."
|
|
|
|
-c quit
|
|
|
|
DEPENDS
|
2016-01-06 00:00:31 -07:00
|
|
|
copy_docfiles
|
2015-04-02 09:45:34 -07:00
|
|
|
nvim
|
2015-07-26 03:39:34 -07:00
|
|
|
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
|
2015-04-02 09:45:34 -07:00
|
|
|
)
|
|
|
|
|
2016-06-05 00:36:51 -07:00
|
|
|
add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
|
|
|
|
DEPENDS
|
|
|
|
helptags
|
|
|
|
)
|
|
|
|
|
2016-06-04 23:35:15 -07:00
|
|
|
add_custom_target(doc_html
|
|
|
|
COMMAND make html
|
|
|
|
DEPENDS
|
|
|
|
${GENERATED_HELP_TAGS}
|
|
|
|
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
|
|
|
|
)
|
|
|
|
|
2015-04-02 09:45:34 -07:00
|
|
|
add_custom_target(
|
|
|
|
runtime ALL
|
|
|
|
DEPENDS
|
|
|
|
${GENERATED_SYN_VIM}
|
|
|
|
${GENERATED_HELP_TAGS}
|
|
|
|
)
|
|
|
|
|
|
|
|
# CMake is painful here. It will create the destination using the user's
|
|
|
|
# current umask, and we don't want that. And we don't just want to install
|
|
|
|
# the target directory, as it will mess with existing permissions. So this
|
|
|
|
# seems like the best compromise. If we create it, then everyone can see it.
|
|
|
|
# If it's preexisting, leave it alone.
|
|
|
|
|
|
|
|
install_helper(
|
2015-07-26 14:37:35 -07:00
|
|
|
FILES ${GENERATED_HELP_TAGS} ${BUILDDOCFILES}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/doc)
|
2015-04-02 09:45:34 -07:00
|
|
|
|
2015-08-11 21:44:34 -07:00
|
|
|
install_helper(
|
|
|
|
FILES ${GENERATED_SYN_VIM}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/syntax/vim)
|
|
|
|
|
2015-04-02 09:45:34 -07:00
|
|
|
file(GLOB_RECURSE RUNTIME_PROGRAMS
|
|
|
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
2015-07-26 14:37:35 -07:00
|
|
|
*.awk *.sh *.bat)
|
2015-04-02 09:45:34 -07:00
|
|
|
|
|
|
|
foreach(PROG ${RUNTIME_PROGRAMS})
|
|
|
|
get_filename_component(BASEDIR ${PROG} PATH)
|
|
|
|
install_helper(PROGRAMS ${PROG}
|
2015-07-26 14:37:35 -07:00
|
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/${BASEDIR})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
file(GLOB_RECURSE RUNTIME_FILES
|
|
|
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
2015-08-16 06:43:52 -07:00
|
|
|
*.vim *.dict *.py *.ps *.tutor)
|
2015-07-26 14:37:35 -07:00
|
|
|
|
|
|
|
foreach(F ${RUNTIME_FILES})
|
|
|
|
get_filename_component(BASEDIR ${F} PATH)
|
|
|
|
install_helper(FILES ${F}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/${BASEDIR})
|
2015-04-02 09:45:34 -07:00
|
|
|
endforeach()
|