Cmake build: Don't use temporary doc-files as source for installation

(cherry picked from commit 336f94d12f)
This commit is contained in:
Kornel Benko 2017-10-05 20:16:52 +02:00
parent c194f60d55
commit 88cba7dee3

View File

@ -15,6 +15,7 @@ file(GLOB_RECURSE _rel_lyx_docs RELATIVE "${TOP_SRC_DIR}/lib/doc"
list(REMOVE_ITEM _rel_lyx_docs LFUNs.lyx) list(REMOVE_ITEM _rel_lyx_docs LFUNs.lyx)
foreach(_rel_doc ${_rel_lyx_docs}) foreach(_rel_doc ${_rel_lyx_docs})
if (NOT "${_rel_doc}" MATCHES "#" )
if ("${_rel_doc}" MATCHES "/" ) if ("${_rel_doc}" MATCHES "/" )
string(REGEX REPLACE "/[^/]*$" "" _rel_dir_part ${_rel_doc}) string(REGEX REPLACE "/[^/]*$" "" _rel_dir_part ${_rel_doc})
else("${_rel_doc}" MATCHES "/") else("${_rel_doc}" MATCHES "/")
@ -23,10 +24,10 @@ foreach(_rel_doc ${_rel_lyx_docs})
set(_created_doc "${CMAKE_CURRENT_BINARY_DIR}/${_rel_doc}") set(_created_doc "${CMAKE_CURRENT_BINARY_DIR}/${_rel_doc}")
get_filename_component(_doc_dir ${_created_doc} PATH) get_filename_component(_doc_dir ${_created_doc} PATH)
file(MAKE_DIRECTORY ${_doc_dir}) file(MAKE_DIRECTORY ${_doc_dir})
#message("found relative file " ${_rel_doc}) #message(STATUS "found relative file " ${_rel_doc})
#message("input ${TOP_SRC_DIR}/lib/doc/${_rel_doc}") #message(STATUS "input ${TOP_SRC_DIR}/lib/doc/${_rel_doc}")
#message("output ${_created_doc}") #message(STATUS "output ${_created_doc}")
#message("rel_dir_part ${_rel_dir_part}") #message(STATUS "rel_dir_part ${_rel_dir_part}")
SET_SOURCE_FILES_PROPERTIES(${_created_doc} GENERATED) SET_SOURCE_FILES_PROPERTIES(${_created_doc} GENERATED)
add_custom_command( add_custom_command(
OUTPUT "${_created_doc}" OUTPUT "${_created_doc}"
@ -39,6 +40,7 @@ foreach(_rel_doc ${_rel_lyx_docs})
) )
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${_rel_doc}" DESTINATION "${LYX_DATA_SUBDIR}doc/${_rel_dir_part}") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${_rel_doc}" DESTINATION "${LYX_DATA_SUBDIR}doc/${_rel_dir_part}")
LIST(APPEND _docs "${_created_doc}") LIST(APPEND _docs "${_created_doc}")
endif()
endforeach(_rel_doc) endforeach(_rel_doc)
# Special commands to create and install LFUNs.lyx # Special commands to create and install LFUNs.lyx