summaryrefslogtreecommitdiffstats
path: root/Utilities/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-03-01 13:43:54 (GMT)
committerBrad King <brad.king@kitware.com>2010-03-01 13:50:12 (GMT)
commit03f8820e64a90cb0ac1c2061923333e574419849 (patch)
tree6fca5d6f4aa38cc042ed4b4ee7fd861403d29046 /Utilities/CMakeLists.txt
parentefa4eb446ebd819ad688780f4de9e1b0a1d0c2a7 (diff)
downloadCMake-03f8820e64a90cb0ac1c2061923333e574419849.zip
CMake-03f8820e64a90cb0ac1c2061923333e574419849.tar.gz
CMake-03f8820e64a90cb0ac1c2061923333e574419849.tar.bz2
Documentation: Cleanup installation rules
Organize Utilities/CMakeLists.txt to avoid duplicate install command calls. We collect each type of documentation in a variable listing its files for installation and then use one install call at the end.
Diffstat (limited to 'Utilities/CMakeLists.txt')
-rw-r--r--Utilities/CMakeLists.txt64
1 files changed, 35 insertions, 29 deletions
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index 2121d0b..24f735b 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -16,6 +16,35 @@ MAKE_DIRECTORY(${CMake_BINARY_DIR}/Docs)
# Add a documentation target.
SET(DOC_FILES "")
+SET(MAN_FILES
+ ${CMake_BINARY_DIR}/Docs/cmake.1
+ ${CMake_BINARY_DIR}/Docs/cmakecommands.1
+ ${CMake_BINARY_DIR}/Docs/cmakecompat.1
+ ${CMake_BINARY_DIR}/Docs/cmakeprops.1
+ ${CMake_BINARY_DIR}/Docs/cmakepolicies.1
+ ${CMake_BINARY_DIR}/Docs/cmakevars.1
+ ${CMake_BINARY_DIR}/Docs/cmakemodules.1
+ )
+SET(TEXT_FILES
+ ${CMake_BINARY_DIR}/Docs/cmake.txt
+ ${CMake_BINARY_DIR}/Docs/cmake.docbook
+ ${CMake_BINARY_DIR}/Docs/cmake-policies.txt
+ ${CMake_BINARY_DIR}/Docs/cmake-properties.txt
+ ${CMake_BINARY_DIR}/Docs/cmake-variables.txt
+ ${CMake_BINARY_DIR}/Docs/cmake-modules.txt
+ ${CMake_BINARY_DIR}/Docs/cmake-commands.txt
+ ${CMake_BINARY_DIR}/Docs/cmake-compatcommands.txt
+ )
+SET(HTML_FILES
+ ${CMake_BINARY_DIR}/Docs/cmake.html
+ ${CMake_BINARY_DIR}/Docs/cmake-policies.html
+ ${CMake_BINARY_DIR}/Docs/cmake-properties.html
+ ${CMake_BINARY_DIR}/Docs/cmake-variables.html
+ ${CMake_BINARY_DIR}/Docs/cmake-modules.html
+ ${CMake_BINARY_DIR}/Docs/cmake-commands.html
+ ${CMake_BINARY_DIR}/Docs/cmake-compatcommands.html
+ )
+
MACRO(ADD_DOCS target dependency)
# Generate documentation for "ctest" executable.
GET_TARGET_PROPERTY(CMD ${target} LOCATION)
@@ -32,13 +61,13 @@ MACRO(ADD_DOCS target dependency)
DEPENDS ${target}
MAIN_DEPENDENCY ${dependency}
)
- INSTALL_FILES(${CMAKE_MAN_DIR}/man1 FILES ${CMake_BINARY_DIR}/Docs/${target}.1)
- INSTALL_FILES(${CMAKE_DOC_DIR} FILES
+ SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/${target}.txt)
+ LIST(APPEND MAN_FILES ${CMake_BINARY_DIR}/Docs/${target}.1)
+ LIST(APPEND TEXT_FILES
${CMake_BINARY_DIR}/Docs/${target}.txt
- ${CMake_BINARY_DIR}/Docs/${target}.html
${CMake_BINARY_DIR}/Docs/${target}.docbook
)
- SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/${target}.txt)
+ LIST(APPEND HTML_FILES ${CMake_BINARY_DIR}/Docs/${target}.html)
ENDIF(CMD)
ENDMACRO(ADD_DOCS target dependency)
@@ -95,31 +124,8 @@ ADD_CUSTOM_COMMAND(
MAIN_DEPENDENCY ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt
)
-INSTALL_FILES(${CMAKE_MAN_DIR}/man1 FILES
- ${CMake_BINARY_DIR}/Docs/cmake.1
- ${CMake_BINARY_DIR}/Docs/cmakecommands.1
- ${CMake_BINARY_DIR}/Docs/cmakecompat.1
- ${CMake_BINARY_DIR}/Docs/cmakeprops.1
- ${CMake_BINARY_DIR}/Docs/cmakepolicies.1
- ${CMake_BINARY_DIR}/Docs/cmakevars.1
- ${CMake_BINARY_DIR}/Docs/cmakemodules.1)
-
-INSTALL_FILES(${CMAKE_DOC_DIR} FILES
- ${CMake_BINARY_DIR}/Docs/cmake.txt
- ${CMake_BINARY_DIR}/Docs/cmake.html
- ${CMake_BINARY_DIR}/Docs/cmake.docbook
- ${CMake_BINARY_DIR}/Docs/cmake-policies.txt
- ${CMake_BINARY_DIR}/Docs/cmake-policies.html
- ${CMake_BINARY_DIR}/Docs/cmake-properties.txt
- ${CMake_BINARY_DIR}/Docs/cmake-properties.html
- ${CMake_BINARY_DIR}/Docs/cmake-variables.txt
- ${CMake_BINARY_DIR}/Docs/cmake-variables.html
- ${CMake_BINARY_DIR}/Docs/cmake-modules.txt
- ${CMake_BINARY_DIR}/Docs/cmake-modules.html
- ${CMake_BINARY_DIR}/Docs/cmake-commands.txt
- ${CMake_BINARY_DIR}/Docs/cmake-commands.html
- ${CMake_BINARY_DIR}/Docs/cmake-compatcommands.txt
- ${CMake_BINARY_DIR}/Docs/cmake-compatcommands.html )
+INSTALL_FILES(${CMAKE_MAN_DIR}/man1 FILES ${MAN_FILES})
+INSTALL_FILES(${CMAKE_DOC_DIR} FILES ${HTML_FILES} ${TEXT_FILES})
# Drive documentation generation.
ADD_CUSTOM_TARGET(documentation ALL DEPENDS ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/cmake.txt )