From 88cba7dee30683b489fbf6772c5b414dd626380c Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Thu, 5 Oct 2017 20:16:52 +0200 Subject: [PATCH] Cmake build: Don't use temporary doc-files as source for installation (cherry picked from commit 336f94d12f806cdc947a71bf89b3319fa4b0e7db) --- development/cmake/doc/CMakeLists.txt | 50 +++++++++++++++------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/development/cmake/doc/CMakeLists.txt b/development/cmake/doc/CMakeLists.txt index 9391e2cc7d..647522f214 100644 --- a/development/cmake/doc/CMakeLists.txt +++ b/development/cmake/doc/CMakeLists.txt @@ -15,30 +15,32 @@ file(GLOB_RECURSE _rel_lyx_docs RELATIVE "${TOP_SRC_DIR}/lib/doc" list(REMOVE_ITEM _rel_lyx_docs LFUNs.lyx) foreach(_rel_doc ${_rel_lyx_docs}) - if ("${_rel_doc}" MATCHES "/" ) - string(REGEX REPLACE "/[^/]*$" "" _rel_dir_part ${_rel_doc}) - else("${_rel_doc}" MATCHES "/") - set(_rel_dir_part ".") - endif("${_rel_doc}" MATCHES "/") - set(_created_doc "${CMAKE_CURRENT_BINARY_DIR}/${_rel_doc}") - get_filename_component(_doc_dir ${_created_doc} PATH) - file(MAKE_DIRECTORY ${_doc_dir}) - #message("found relative file " ${_rel_doc}) - #message("input ${TOP_SRC_DIR}/lib/doc/${_rel_doc}") - #message("output ${_created_doc}") - #message("rel_dir_part ${_rel_dir_part}") - SET_SOURCE_FILES_PROPERTIES(${_created_doc} GENERATED) - add_custom_command( - OUTPUT "${_created_doc}" - COMMAND ${LYX_PYTHON_EXECUTABLE} "${TOP_CMAKE_PATH}/doc/ReplaceValues.py" - "LYX_USERDIR_VER=${LYX_USERDIR_VER}" - "LYX_DIR_VER=${LYX_DIR_VER}" - "\\origin\ unavailable=\\origin\ /systemlyxdir/doc/${_rel_dir_part}" - "${TOP_SRC_DIR}/lib/doc/${_rel_doc}" > "${_created_doc}" - DEPENDS "${TOP_SRC_DIR}/lib/doc/${_rel_doc}" "${TOP_CMAKE_PATH}/doc/ReplaceValues.py" - ) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${_rel_doc}" DESTINATION "${LYX_DATA_SUBDIR}doc/${_rel_dir_part}") - LIST(APPEND _docs "${_created_doc}") + if (NOT "${_rel_doc}" MATCHES "#" ) + if ("${_rel_doc}" MATCHES "/" ) + string(REGEX REPLACE "/[^/]*$" "" _rel_dir_part ${_rel_doc}) + else("${_rel_doc}" MATCHES "/") + set(_rel_dir_part ".") + endif("${_rel_doc}" MATCHES "/") + set(_created_doc "${CMAKE_CURRENT_BINARY_DIR}/${_rel_doc}") + get_filename_component(_doc_dir ${_created_doc} PATH) + file(MAKE_DIRECTORY ${_doc_dir}) + #message(STATUS "found relative file " ${_rel_doc}) + #message(STATUS "input ${TOP_SRC_DIR}/lib/doc/${_rel_doc}") + #message(STATUS "output ${_created_doc}") + #message(STATUS "rel_dir_part ${_rel_dir_part}") + SET_SOURCE_FILES_PROPERTIES(${_created_doc} GENERATED) + add_custom_command( + OUTPUT "${_created_doc}" + COMMAND ${LYX_PYTHON_EXECUTABLE} "${TOP_CMAKE_PATH}/doc/ReplaceValues.py" + "LYX_USERDIR_VER=${LYX_USERDIR_VER}" + "LYX_DIR_VER=${LYX_DIR_VER}" + "\\origin\ unavailable=\\origin\ /systemlyxdir/doc/${_rel_dir_part}" + "${TOP_SRC_DIR}/lib/doc/${_rel_doc}" > "${_created_doc}" + DEPENDS "${TOP_SRC_DIR}/lib/doc/${_rel_doc}" "${TOP_CMAKE_PATH}/doc/ReplaceValues.py" + ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${_rel_doc}" DESTINATION "${LYX_DATA_SUBDIR}doc/${_rel_dir_part}") + LIST(APPEND _docs "${_created_doc}") + endif() endforeach(_rel_doc) # Special commands to create and install LFUNs.lyx