summaryrefslogtreecommitdiff
path: root/Utilities/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-02-24 09:00:42 -0500
committerBrad King <brad.king@kitware.com>2009-02-24 09:00:42 -0500
commit0d2f241e1a3de469e2843f1fcc12f15a80301bed (patch)
tree534fe1270f304c6b90549877af6aa4276e73612d /Utilities/CMakeLists.txt
parenta58e1836360758f75fe16dc85c659c69a9d50cdf (diff)
downloadcmake-0d2f241e1a3de469e2843f1fcc12f15a80301bed.tar.gz
ENH: Help cmake-gui docs generation on Windows
We use a custom command to run 'cmake-gui --help...' to generate the documentation for the application. Since this is a Qt application, the executable must find the Qt DLLs in order to run. As a convenience, if QtCore4.dll appears next to qmake.exe, we put its location in the PATH environment variable when running the custom command on Windows.
Diffstat (limited to 'Utilities/CMakeLists.txt')
-rw-r--r--Utilities/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index fb935f3a96..499bb42bc0 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -12,6 +12,7 @@ MACRO(ADD_DOCS target dependency)
IF(CMD)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMake_BINARY_DIR}/Docs/${target}.txt
+ ${${target}-PATH} # Possibly set PATH, see below.
COMMAND ${CMD}
ARGS --help-full ${CMake_BINARY_DIR}/Docs/${target}.txt
--help-full ${CMake_BINARY_DIR}/Docs/${target}.html
@@ -30,6 +31,16 @@ MACRO(ADD_DOCS target dependency)
ENDIF(CMD)
ENDMACRO(ADD_DOCS target dependency)
+# Help cmake-gui find the Qt DLLs on Windows.
+IF(BUILD_QtDialog AND WIN32 AND EXISTS "${QT_QMAKE_EXECUTABLE}")
+ GET_FILENAME_COMPONENT(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
+ IF(EXISTS "${Qt_BIN_DIR}/QtCore4.dll")
+ # Tell the macro to set the path before running cmake-gui.
+ STRING(REPLACE ";" "\\;" _PATH "PATH=${Qt_BIN_DIR};%PATH%")
+ SET(cmake-gui-PATH COMMAND set "${_PATH}")
+ ENDIF(EXISTS "${Qt_BIN_DIR}/QtCore4.dll")
+ENDIF(BUILD_QtDialog AND WIN32 AND EXISTS "${QT_QMAKE_EXECUTABLE}")
+
# add the docs for the executables
ADD_DOCS(ctest ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt)
ADD_DOCS(cpack ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt)