medit/doc/CMakeLists.txt

51 lines
2.7 KiB
CMake
Raw Normal View History

2009-11-01 12:44:46 -08:00
FIND_PACKAGE(Perl)
2010-01-17 00:52:16 -08:00
GET_FILENAME_COMPONENT(MOO_HELP_FILES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/help ABSOLUTE)
FILE(MAKE_DIRECTORY ${MOO_HELP_FILES_DIR})
2009-11-30 08:02:58 -08:00
IF(MOO_DEV_MODE)
SET(MOO_HELP_T2T_FILES
license.t2t
prefs-file.t2t
prefs.t2t
user-tools.t2t
2010-01-17 00:52:16 -08:00
regex.t2t
2009-11-30 08:02:58 -08:00
man-medit.t2t
)
GET_FILENAME_COMPONENT(MOO_HELP_T2T_MAIN ${CMAKE_CURRENT_SOURCE_DIR}/medit.t2t ABSOLUTE)
GET_FILENAME_COMPONENT(MOO_HELP_T2T_MAN ${CMAKE_CURRENT_SOURCE_DIR}/man-medit.t2t ABSOLUTE)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/medit.t2t.in ${MOO_HELP_T2T_MAIN} @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/man-medit.t2t.in ${MOO_HELP_T2T_MAN} @ONLY)
GET_FILENAME_COMPONENT(MOO_HELP_HTML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/help.html ABSOLUTE)
GET_FILENAME_COMPONENT(MOO_MAKEDOCS_CMAKE ${CMAKE_CURRENT_SOURCE_DIR}/makedocs.cmake ABSOLUTE)
GET_FILENAME_COMPONENT(MOO_HELP_MAN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/medit.1 ABSOLUTE)
GET_FILENAME_COMPONENT(MOO_HELP_SECTIONS_H ${CMAKE_CURRENT_SOURCE_DIR}/help-sections.h ABSOLUTE)
GET_FILENAME_COMPONENT(MOO_HELP_TXT2TAGS_PY ${CMAKE_CURRENT_SOURCE_DIR}/txt2tags/txt2tags.py ABSOLUTE)
ADD_CUSTOM_COMMAND(OUTPUT ${MOO_HELP_HTML_FILE}
COMMAND ${CMAKE_COMMAND} -D INPUT_FILE=${MOO_HELP_T2T_MAIN}
-D OUTPUT_FILE=${MOO_HELP_HTML_FILE}
-D OUTPUT_DIR=${MOO_HELP_FILES_DIR}
-D SECTIONS_FILE=${MOO_HELP_SECTIONS_H}
-D MAN_INPUT_FILE=${MOO_HELP_T2T_MAN}
-D MAN_OUTPUT_FILE=${MOO_HELP_MAN_FILE}
-D PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
-D PERL_EXECUTABLE=${PERL_EXECUTABLE}
-D TXT2TAGS=${MOO_HELP_TXT2TAGS_PY}
-P ${MOO_MAKEDOCS_CMAKE}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
MAIN_DEPENDENCY ${MOO_HELP_T2T_MAIN}
DEPENDS ${MOO_MAKEDOCS_CMAKE} ${MOO_HELP_T2T_FILES})
SET_SOURCE_FILES_PROPERTIES(${MOO_HELP_MAN_FILE} PROPERTIES EXTERNAL_OBJECT 1 GENERATED 1)
SET_SOURCE_FILES_PROPERTIES(${MOO_HELP_SECTIONS_H} ${MOO_HELP_T2T_MAIN} ${MOO_HELP_T2T_MAN} PROPERTIES GENERATED 1)
ADD_CUSTOM_TARGET(doc ALL DEPENDS ${MOO_HELP_HTML_FILE})
ENDIF(MOO_DEV_MODE)
2009-11-01 12:44:46 -08:00
INSTALL(DIRECTORY ${MOO_HELP_FILES_DIR}/ DESTINATION ${MOO_HELP_DIR})
# ADD_CUSTOM_TARGET(doc-clean COMMAND ${CMAKE_COMMAND} -E remove ${MOO_DOC_MEDIT_TXT} ${MOO_DOC_HTML_FILE} ${MOO_HELP_SECTIONS_H} ${MOO_DOC_STAMP_FILE})