Cmake build: Don't try to convert non-lyx-files.

Since they are not supposed to contain versioned strings like LYX_DIR_VER,
it is sufficient to copy them instead.
Besides, they also may be non-utf-8 coded, which would also break the conversion.
This commit is contained in:
Kornel Benko 2017-11-28 19:07:24 +01:00
parent 4c49463c61
commit 1844d22221

View File

@ -29,20 +29,29 @@ foreach(_rel_doc ${_rel_lyx_docs})
#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 ${CMAKE_COMMAND}
-DLYX_PYTHON_EXECUTABLE=${LYX_PYTHON_EXECUTABLE}
-DTOP_CMAKE_PATH=${TOP_CMAKE_PATH}
-DLYX_USERDIR_VER=${LYX_USERDIR_VER}
-DLYX_DIR_VER=${LYX_DIR_VER}
-DTOP_SRC_DIR=${TOP_SRC_DIR}
-DREL_DIR=${_rel_dir_part}
-DSOURCE=${_rel_doc}
-DCREATED=${_created_doc}
-P "${TOP_CMAKE_PATH}/doc/ReplaceValues.cmake"
DEPENDS "${TOP_SRC_DIR}/lib/doc/${_rel_doc}" "${TOP_CMAKE_PATH}/doc/ReplaceValues.py"
if ("${_rel_doc}" MATCHES ".lyx$")
add_custom_command(
OUTPUT "${_created_doc}"
COMMAND ${CMAKE_COMMAND}
-DLYX_PYTHON_EXECUTABLE=${LYX_PYTHON_EXECUTABLE}
-DTOP_CMAKE_PATH=${TOP_CMAKE_PATH}
-DLYX_USERDIR_VER=${LYX_USERDIR_VER}
-DLYX_DIR_VER=${LYX_DIR_VER}
-DTOP_SRC_DIR=${TOP_SRC_DIR}
-DREL_DIR=${_rel_dir_part}
-DSOURCE=${_rel_doc}
-DCREATED=${_created_doc}
-P "${TOP_CMAKE_PATH}/doc/ReplaceValues.cmake"
DEPENDS "${TOP_SRC_DIR}/lib/doc/${_rel_doc}" "${TOP_CMAKE_PATH}/doc/ReplaceValues.py"
)
else()
# Copy only
add_custom_command(
OUTPUT "${_created_doc}"
COMMAND ${CMAKE_COMMAND}
-E copy_if_different "${TOP_SRC_DIR}/lib/doc/${_rel_doc}" "${_created_doc}"
)
endif()
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${_rel_doc}" DESTINATION "${LYX_DATA_SUBDIR}doc/${_rel_dir_part}")
LIST(APPEND _docs "${_created_doc}")
endif()