2009-01-03 10:53:24 +00:00
|
|
|
# This file is part of LyX, the document processor.
|
|
|
|
# Licence details can be found in the file COPYING.
|
|
|
|
#
|
2011-01-10 23:24:00 +00:00
|
|
|
# Copyright (c) 2008-2011 Peter Kümmel, <syntheticpp@gmx.net>
|
|
|
|
# Copyright (c) 2008-2011 Kornel Benko, <Kornel.Benko@berlin.de>
|
2009-01-03 10:53:24 +00:00
|
|
|
#
|
|
|
|
|
2009-01-06 18:51:00 +00:00
|
|
|
project(doc)
|
|
|
|
|
2009-01-03 10:53:24 +00:00
|
|
|
SET(_docs)
|
2013-01-13 14:31:23 +00:00
|
|
|
file(GLOB_RECURSE _rel_lyx_docs RELATIVE "${TOP_SRC_DIR}/lib/doc"
|
|
|
|
"${TOP_SRC_DIR}/lib/doc/*.lyx"
|
|
|
|
"${TOP_SRC_DIR}/lib/doc/*.txt"
|
|
|
|
"${TOP_SRC_DIR}/lib/doc/*.tex")
|
2011-05-22 12:45:12 +00:00
|
|
|
list(REMOVE_ITEM _rel_lyx_docs LFUNs.lyx)
|
2009-01-03 10:53:24 +00:00
|
|
|
|
|
|
|
foreach(_rel_doc ${_rel_lyx_docs})
|
2017-10-05 18:16:52 +00:00
|
|
|
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)
|
2017-11-28 18:07:24 +00:00
|
|
|
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}"
|
2017-10-05 18:16:52 +00:00
|
|
|
)
|
2017-11-28 18:07:24 +00:00
|
|
|
endif()
|
2017-10-05 18:16:52 +00:00
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${_rel_doc}" DESTINATION "${LYX_DATA_SUBDIR}doc/${_rel_dir_part}")
|
|
|
|
LIST(APPEND _docs "${_created_doc}")
|
|
|
|
endif()
|
2009-01-03 10:53:24 +00:00
|
|
|
endforeach(_rel_doc)
|
|
|
|
|
2011-05-22 12:45:12 +00:00
|
|
|
# Special commands to create and install LFUNs.lyx
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT LFUNs.lyx
|
|
|
|
COMMAND ${LYX_PYTHON_EXECUTABLE} "${TOP_SRC_DIR}/development/tools/gen_lfuns.py" "${TOP_SRC_DIR}/src/LyXAction.cpp" > LFUNs.lyx
|
|
|
|
DEPENDS "${TOP_SRC_DIR}/development/tools/gen_lfuns.py" "${TOP_SRC_DIR}/src/LyXAction.cpp")
|
|
|
|
LIST(APPEND _docs "${CMAKE_CURRENT_BINARY_DIR}/LFUNs.lyx")
|
2011-07-04 18:27:50 +00:00
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LFUNs.lyx" DESTINATION "${LYX_DATA_SUBDIR}doc")
|
2011-05-22 12:45:12 +00:00
|
|
|
|
2009-01-03 10:53:24 +00:00
|
|
|
ADD_CUSTOM_TARGET(doc ALL DEPENDS ${_docs})
|
|
|
|
|
2011-05-22 12:45:12 +00:00
|
|
|
ADD_CUSTOM_TARGET(lfundoc DEPENDS LFUNs.lyx)
|
2014-02-03 17:13:00 +00:00
|
|
|
|
|
|
|
set_target_properties(doc lfundoc PROPERTIES FOLDER "doc")
|
|
|
|
|