ENH: Added generation of ccmake documentation on UNIX.

This commit is contained in:
Brad King 2003-07-21 17:14:16 -04:00
parent be68519dd4
commit 3c30dae03a
1 changed files with 40 additions and 9 deletions

View File

@ -1,18 +1,20 @@
SUBDIRS(Doxygen) SUBDIRS(Doxygen)
SET(CMD_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
IF(WIN32) IF(WIN32)
SET(CMD ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/cmake.exe) SET(CMD_EXT ".exe")
ELSE(WIN32) ELSE(WIN32)
SET(CMD ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/cmake) SET(CMD_EXT "")
ENDIF(WIN32) ENDIF(WIN32)
MAKE_DIRECTORY(${CMake_BINARY_DIR}/Docs) MAKE_DIRECTORY(${CMake_BINARY_DIR}/Docs)
# Add a documentation target.
ADD_CUSTOM_TARGET(documentation ALL) ADD_CUSTOM_TARGET(documentation ALL)
ADD_CUSTOM_COMMAND( SET(DOC_FILES "")
TARGET documentation
SOURCE documentation # Generate documentation for "cmake" executable.
DEPENDS ${CMake_BINARY_DIR}/Docs/Copyright.txt SET(CMD ${CMD_DIR}/cmake${CMD_EXT})
)
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
TARGET documentation TARGET documentation
COMMAND ${CMD} COMMAND ${CMD}
@ -22,13 +24,42 @@ ADD_CUSTOM_COMMAND(
--help-man ${CMake_BINARY_DIR}/Docs/cmake.1 --help-man ${CMake_BINARY_DIR}/Docs/cmake.1
DEPENDS ${CMD} DEPENDS ${CMD}
SOURCE ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt SOURCE ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt
OUTPUTS ${CMake_BINARY_DIR}/Docs/Copyright.txt OUTPUTS ${CMake_BINARY_DIR}/Docs/cmake.txt
) )
ADD_DEPENDENCIES(documentation cmake) ADD_DEPENDENCIES(documentation cmake)
INSTALL_FILES(${CMAKE_MAN_DIR}/man1 FILES ${CMake_BINARY_DIR}/Docs/cmake.1) INSTALL_FILES(${CMAKE_MAN_DIR}/man1 FILES ${CMake_BINARY_DIR}/Docs/cmake.1)
INSTALL_FILES(${CMAKE_DOC_DIR} FILES INSTALL_FILES(${CMAKE_DOC_DIR} FILES
${CMake_BINARY_DIR}/Docs/Copyright.txt ${CMake_BINARY_DIR}/Docs/Copyright.txt
${CMake_BINARY_DIR}/Docs/cmake.txt ${CMake_BINARY_DIR}/Docs/cmake.txt
${CMake_BINARY_DIR}/Docs/cmake.html ${CMake_BINARY_DIR}/Docs/cmake.html
) )
SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/cmake.txt)
# Generate documentation for "ccmake" executable.
IF(UNIX)
SET(CMD ${CMD_DIR}/ccmake${CMD_EXT})
ADD_CUSTOM_COMMAND(
TARGET documentation
COMMAND ${CMD}
ARGS --help-full ${CMake_BINARY_DIR}/Docs/ccmake.txt
--help-html ${CMake_BINARY_DIR}/Docs/ccmake.html
--help-man ${CMake_BINARY_DIR}/Docs/ccmake.1
DEPENDS ${CMD}
SOURCE ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt
OUTPUTS ${CMake_BINARY_DIR}/Docs/ccmake.txt
)
ADD_DEPENDENCIES(documentation ccmake)
INSTALL_FILES(${CMAKE_MAN_DIR}/man1 FILES ${CMake_BINARY_DIR}/Docs/ccmake.1)
INSTALL_FILES(${CMAKE_DOC_DIR} FILES
${CMake_BINARY_DIR}/Docs/ccmake.txt
${CMake_BINARY_DIR}/Docs/ccmake.html
)
SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/ccmake.txt)
ENDIF(UNIX)
# Drive documentation generation.
ADD_CUSTOM_COMMAND(
TARGET documentation
SOURCE documentation
DEPENDS ${DOC_FILES}
)