Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / CMakeLists.txt
blob6f7845ef24200abd6836def088b275d11d68e605
1 SUBDIRS(Doxygen KWStyle)
3 MAKE_DIRECTORY(${CMake_BINARY_DIR}/Docs)
5 # Add a documentation target.
6 SET(DOC_FILES "")
8 MACRO(ADD_DOCS target dependency)
9   # Generate documentation for "ctest" executable.
10   GET_TARGET_PROPERTY(CMD ${target} LOCATION)
11   # only generate the documentation if the target is actually built
12   IF(CMD)
13     ADD_CUSTOM_COMMAND(
14       OUTPUT ${CMake_BINARY_DIR}/Docs/${target}.txt
15       ${${target}-PATH} # Possibly set PATH, see below.
16       COMMAND ${CMD}
17       ARGS --help-full ${CMake_BINARY_DIR}/Docs/${target}.txt
18            --help-full ${CMake_BINARY_DIR}/Docs/${target}.html
19            --help-full ${CMake_BINARY_DIR}/Docs/${target}.1
20            --help-full ${CMake_BINARY_DIR}/Docs/${target}.docbook
21       DEPENDS ${target}
22       MAIN_DEPENDENCY ${dependency}
23       )
24     INSTALL_FILES(${CMAKE_MAN_DIR}/man1 FILES ${CMake_BINARY_DIR}/Docs/${target}.1)
25     INSTALL_FILES(${CMAKE_DOC_DIR} FILES
26       ${CMake_BINARY_DIR}/Docs/${target}.txt
27       ${CMake_BINARY_DIR}/Docs/${target}.html
28       ${CMake_BINARY_DIR}/Docs/${target}.docbook
29       )
30     SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/${target}.txt)
31   ENDIF(CMD)
32 ENDMACRO(ADD_DOCS target dependency)
34 # Help cmake-gui find the Qt DLLs on Windows.
35 SET(WIN_SHELL_GENS "Visual Studio|NMake|MinGW|Watcom|Borland")
36 IF(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}"
37     AND EXISTS "${QT_QMAKE_EXECUTABLE}" AND NOT CMAKE_NO_AUTO_QT_ENV)
38   GET_FILENAME_COMPONENT(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
39   IF(EXISTS "${Qt_BIN_DIR}/QtCore4.dll")
40     # Tell the macro to set the path before running cmake-gui.
41     STRING(REPLACE ";" "\\;" _PATH "PATH=${Qt_BIN_DIR};%PATH%")
42     SET(cmake-gui-PATH COMMAND set "${_PATH}")
43   ENDIF(EXISTS "${Qt_BIN_DIR}/QtCore4.dll")
44 ENDIF(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}"
45   AND EXISTS "${QT_QMAKE_EXECUTABLE}" AND NOT CMAKE_NO_AUTO_QT_ENV)
47 # add the docs for the executables
48 ADD_DOCS(ctest      ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt)
49 ADD_DOCS(cpack      ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt)
50 ADD_DOCS(ccmake     ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt)
51 ADD_DOCS(CMakeSetup ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in)
52 ADD_DOCS(cmake-gui ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in)
54 # add the documentation for cmake itself
56 GET_TARGET_PROPERTY(CMD cmake LOCATION)
57 ADD_CUSTOM_COMMAND(
58   OUTPUT ${CMake_BINARY_DIR}/Docs/cmake.txt
59   COMMAND ${CMD} 
60   ARGS --copyright ${CMake_BINARY_DIR}/Docs/Copyright.txt
61        --help-full ${CMake_BINARY_DIR}/Docs/cmake.txt
62        --help-full ${CMake_BINARY_DIR}/Docs/cmake.html
63        --help-full ${CMake_BINARY_DIR}/Docs/cmake.1
64        --help-full ${CMake_BINARY_DIR}/Docs/cmake.docbook
65        --help-policies ${CMake_BINARY_DIR}/Docs/cmake-policies.txt
66        --help-policies ${CMake_BINARY_DIR}/Docs/cmake-policies.html
67        --help-policies ${CMake_BINARY_DIR}/Docs/cmakepolicies.1
68        --help-properties ${CMake_BINARY_DIR}/Docs/cmake-properties.txt
69        --help-properties ${CMake_BINARY_DIR}/Docs/cmake-properties.html
70        --help-properties ${CMake_BINARY_DIR}/Docs/cmakeprops.1
71        --help-variables ${CMake_BINARY_DIR}/Docs/cmake-variables.txt
72        --help-variables ${CMake_BINARY_DIR}/Docs/cmake-variables.html
73        --help-variables ${CMake_BINARY_DIR}/Docs/cmakevars.1
74        --help-modules ${CMake_BINARY_DIR}/Docs/cmake-modules.txt
75        --help-modules ${CMake_BINARY_DIR}/Docs/cmake-modules.html
76        --help-modules ${CMake_BINARY_DIR}/Docs/cmakemodules.1
77        --help-commands ${CMake_BINARY_DIR}/Docs/cmake-commands.txt
78        --help-commands ${CMake_BINARY_DIR}/Docs/cmake-commands.html
79        --help-commands ${CMake_BINARY_DIR}/Docs/cmakecommands.1
80        --help-compatcommands ${CMake_BINARY_DIR}/Docs/cmake-compatcommands.txt
81        --help-compatcommands ${CMake_BINARY_DIR}/Docs/cmake-compatcommands.html
82        --help-compatcommands ${CMake_BINARY_DIR}/Docs/cmakecompat.1
83   DEPENDS cmake
84   MAIN_DEPENDENCY ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt
85   )
87 INSTALL_FILES(${CMAKE_MAN_DIR}/man1 FILES
88               ${CMake_BINARY_DIR}/Docs/cmake.1
89               ${CMake_BINARY_DIR}/Docs/cmakecommands.1
90               ${CMake_BINARY_DIR}/Docs/cmakecompat.1
91               ${CMake_BINARY_DIR}/Docs/cmakeprops.1
92               ${CMake_BINARY_DIR}/Docs/cmakepolicies.1
93               ${CMake_BINARY_DIR}/Docs/cmakevars.1
94               ${CMake_BINARY_DIR}/Docs/cmakemodules.1)
96 INSTALL_FILES(${CMAKE_DOC_DIR} FILES
97     ${CMake_BINARY_DIR}/Docs/cmake.txt
98     ${CMake_BINARY_DIR}/Docs/cmake.html
99     ${CMake_BINARY_DIR}/Docs/cmake.docbook
100     ${CMake_BINARY_DIR}/Docs/cmake-policies.txt
101     ${CMake_BINARY_DIR}/Docs/cmake-policies.html
102     ${CMake_BINARY_DIR}/Docs/cmake-properties.txt
103     ${CMake_BINARY_DIR}/Docs/cmake-properties.html
104     ${CMake_BINARY_DIR}/Docs/cmake-variables.txt
105     ${CMake_BINARY_DIR}/Docs/cmake-variables.html 
106     ${CMake_BINARY_DIR}/Docs/cmake-modules.txt
107     ${CMake_BINARY_DIR}/Docs/cmake-modules.html
108     ${CMake_BINARY_DIR}/Docs/cmake-commands.txt
109     ${CMake_BINARY_DIR}/Docs/cmake-commands.html
110     ${CMake_BINARY_DIR}/Docs/cmake-compatcommands.txt
111     ${CMake_BINARY_DIR}/Docs/cmake-compatcommands.html )
113 # Drive documentation generation.
114 ADD_CUSTOM_TARGET(documentation ALL DEPENDS ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/cmake.txt )