2024-01-19 05:21:25 -07:00
|
|
|
set(GENERATED_RUNTIME_DIR ${PROJECT_BINARY_DIR}/runtime)
|
|
|
|
|
|
|
|
set(GENERATED_HELP_TAGS ${GENERATED_RUNTIME_DIR}/doc/tags)
|
2016-06-26 18:00:05 -07:00
|
|
|
set(GENERATED_PACKAGE_DIR ${GENERATED_RUNTIME_DIR}/pack/dist/opt)
|
2024-01-19 05:21:25 -07:00
|
|
|
set(GENERATED_SYN_VIM ${GENERATED_RUNTIME_DIR}/syntax/vim/generated.vim)
|
|
|
|
set(SYN_VIM_GENERATOR ${PROJECT_SOURCE_DIR}/src/nvim/generators/gen_vimvim.lua)
|
2015-04-02 09:45:34 -07:00
|
|
|
|
|
|
|
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax/vim)
|
|
|
|
|
2023-04-15 03:23:45 -07:00
|
|
|
get_directory_property(LUA_GEN DIRECTORY ${PROJECT_SOURCE_DIR}/src/nvim DEFINITION LUA_GEN)
|
|
|
|
get_directory_property(LUA_GEN_DEPS DIRECTORY ${PROJECT_SOURCE_DIR}/src/nvim DEFINITION LUA_GEN_DEPS)
|
|
|
|
|
2015-04-02 09:45:34 -07:00
|
|
|
add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
|
2023-04-21 07:46:35 -07:00
|
|
|
COMMAND ${LUA_GEN} ${SYN_VIM_GENERATOR} ${GENERATED_SYN_VIM} ${FUNCS_DATA}
|
2015-04-02 09:45:34 -07:00
|
|
|
DEPENDS
|
2023-04-15 03:23:45 -07:00
|
|
|
${LUA_GEN_DEPS}
|
2015-04-02 09:45:34 -07:00
|
|
|
${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
|
2016-06-19 07:41:08 -07:00
|
|
|
${FUNCS_DATA}
|
2015-04-02 09:45:34 -07:00
|
|
|
)
|
|
|
|
|
2023-10-14 04:12:48 -07:00
|
|
|
file(GLOB PACKAGES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/pack/dist/opt/*)
|
2016-06-26 18:00:05 -07:00
|
|
|
|
|
|
|
set(GENERATED_PACKAGE_TAGS)
|
|
|
|
foreach(PACKAGE ${PACKAGES})
|
|
|
|
get_filename_component(PACKNAME ${PACKAGE} NAME)
|
2023-10-14 04:12:48 -07:00
|
|
|
file(GLOB "${PACKNAME}_DOC_FILES" CONFIGURE_DEPENDS ${PACKAGE}/doc/*.txt)
|
2018-06-16 07:56:02 -07:00
|
|
|
if(${PACKNAME}_DOC_FILES)
|
2016-06-26 18:00:05 -07:00
|
|
|
file(MAKE_DIRECTORY ${GENERATED_PACKAGE_DIR}/${PACKNAME})
|
2019-01-01 05:56:20 -07:00
|
|
|
add_custom_command(OUTPUT "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags"
|
2016-06-26 18:00:05 -07:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
${PACKAGE} ${GENERATED_PACKAGE_DIR}/${PACKNAME}
|
2024-01-01 05:08:56 -07:00
|
|
|
COMMAND $<TARGET_FILE:nvim_bin>
|
2016-06-26 18:00:05 -07:00
|
|
|
-u NONE -i NONE -e --headless -c "helptags doc" -c quit
|
|
|
|
DEPENDS
|
2024-01-19 05:21:25 -07:00
|
|
|
nvim_bin
|
2019-01-01 05:56:20 -07:00
|
|
|
nvim_runtime_deps
|
2016-06-26 18:00:05 -07:00
|
|
|
WORKING_DIRECTORY "${GENERATED_PACKAGE_DIR}/${PACKNAME}"
|
|
|
|
)
|
|
|
|
|
|
|
|
set("${PACKNAME}_DOC_NAMES")
|
|
|
|
foreach(DF "${${PACKNAME}_DOC_FILES}")
|
|
|
|
get_filename_component(F ${DF} NAME)
|
|
|
|
list(APPEND "${PACKNAME}_DOC_NAMES" ${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/${F})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
install_helper(
|
|
|
|
FILES ${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags "${${PACKNAME}_DOC_NAMES}"
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/pack/dist/opt/${PACKNAME}/doc)
|
|
|
|
|
|
|
|
list(APPEND GENERATED_PACKAGE_TAGS "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
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()
|
|
|
|
|
2019-01-01 05:56:20 -07:00
|
|
|
add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
|
2022-12-29 05:05:26 -07:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory doc
|
2016-06-15 21:27:11 -07:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2018-11-04 17:54:24 -07:00
|
|
|
${PROJECT_SOURCE_DIR}/runtime/doc doc
|
2024-01-01 05:08:56 -07:00
|
|
|
COMMAND $<TARGET_FILE:nvim_bin>
|
2016-06-15 21:27:11 -07:00
|
|
|
-u NONE -i NONE -e --headless -c "helptags ++t doc" -c quit
|
2015-04-02 09:45:34 -07:00
|
|
|
DEPENDS
|
2024-01-19 05:21:25 -07:00
|
|
|
nvim_bin
|
2019-01-01 05:56:20 -07:00
|
|
|
nvim_runtime_deps
|
2016-06-15 21:27:11 -07:00
|
|
|
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}"
|
2015-04-02 09:45:34 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(
|
2024-01-19 05:21:25 -07:00
|
|
|
nvim_runtime
|
2015-04-02 09:45:34 -07:00
|
|
|
DEPENDS
|
|
|
|
${GENERATED_SYN_VIM}
|
|
|
|
${GENERATED_HELP_TAGS}
|
2016-06-26 18:00:05 -07:00
|
|
|
${GENERATED_PACKAGE_TAGS}
|
2015-04-02 09:45:34 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
# 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)
|
|
|
|
|
2017-07-26 18:52:22 -07:00
|
|
|
if(NOT APPLE)
|
|
|
|
install_helper(
|
|
|
|
FILES ${CMAKE_CURRENT_SOURCE_DIR}/nvim.desktop
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
|
|
|
endif()
|
|
|
|
|
2022-10-13 05:48:12 -07:00
|
|
|
install_helper(
|
|
|
|
FILES ${CMAKE_CURRENT_SOURCE_DIR}/nvim.png
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps)
|
|
|
|
|
2023-10-14 04:12:48 -07:00
|
|
|
file(GLOB RUNTIME_ROOT_FILES CONFIGURE_DEPENDS *.vim *.lua *.ico)
|
2023-03-07 07:00:51 -07:00
|
|
|
install_helper(FILES ${RUNTIME_ROOT_FILES}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/)
|
|
|
|
|
2023-10-14 04:12:48 -07:00
|
|
|
file(GLOB RUNTIME_DIRS CONFIGURE_DEPENDS */)
|
2023-03-07 07:00:51 -07:00
|
|
|
foreach(D ${RUNTIME_DIRS})
|
|
|
|
if(IS_DIRECTORY ${D})
|
|
|
|
install_helper(DIRECTORY ${D}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/)
|
|
|
|
endif()
|
2015-07-26 14:37:35 -07:00
|
|
|
endforeach()
|
|
|
|
|
2023-03-07 07:00:51 -07:00
|
|
|
# only foo.sh script in runtime/
|
2024-10-12 02:23:31 -07:00
|
|
|
install_helper(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/less.sh DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/scripts/)
|