diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-02-09 14:53:52 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-02-09 14:53:52 (GMT) |
commit | f6014938cbb4a914ed5b549261a0c06215593c30 (patch) | |
tree | ddcf95907670ac1fe393f19f05a06218458a0f03 | |
parent | 445f47473c205d9d310a6a51c14fa7ac98c2cad0 (diff) | |
download | CMake-f6014938cbb4a914ed5b549261a0c06215593c30.zip CMake-f6014938cbb4a914ed5b549261a0c06215593c30.tar.gz CMake-f6014938cbb4a914ed5b549261a0c06215593c30.tar.bz2 |
ENH: make it so cmake-gui only installs if qt is static on windows
-rw-r--r-- | CMakeCPack.cmake | 2 | ||||
-rw-r--r-- | CMakeCPackOptions.cmake.in | 9 | ||||
-rw-r--r-- | Source/QtDialog/CMakeLists.txt | 20 | ||||
-rw-r--r-- | Source/QtDialog/QtDialogCPack.cmake.in | 4 |
4 files changed, 20 insertions, 15 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index 24eb061..6532d9e 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -7,6 +7,8 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") MARK_AS_ADVANCED(CMAKE_INSTALL_DEBUG_LIBRARIES) INCLUDE(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake) ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") + # Set the options file that needs to be included inside CMakeCPackOptions.cmake + SET(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake) CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in" "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY) SET(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake") diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index 0c1eac4..d3b35e8 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -3,8 +3,7 @@ # in this file. if(CPACK_GENERATOR MATCHES "NSIS") - SET(BUILD_QtDialog @BUILD_QtDialog@) - SET(CMAKE_QT_IS_STATIC @CMAKE_QT_IS_STATIC@) + SET(QT_DIALOG_OPTIONS_FILE @QT_DIALOG_OPTIONS_FILE@) # set the install/unistall icon used for the installer itself # There is a bug in NSI that does not handle full unix paths properly. SET(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico") @@ -33,11 +32,9 @@ if(CPACK_GENERATOR MATCHES "NSIS") SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\www.kitware.com") SET(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@) SET(CPACK_NSIS_MODIFY_PATH ON) - # only package cmake-gui if QT is static on windows - IF(BUILD_QtDialog AND CMAKE_QT_IS_STATIC) - SET(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "cmake-gui" "cmake-gui(beta)") - ENDIF(BUILD_QtDialog AND CMAKE_QT_IS_STATIC) endif(CPACK_GENERATOR MATCHES "NSIS") +# include the cpack options +INCLUDE("@QT_DIALOG_CPACK_OPTIONS_FILE@") if(CPACK_GENERATOR MATCHES "CygwinSource") # when packaging source make sure the .build directory is not included diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 6576539..8670642 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -1,4 +1,4 @@ - +PROJECT(QtDialog) SET(QT_MIN_VERSION "4.2.0") FIND_PACKAGE(Qt4 REQUIRED) @@ -7,9 +7,14 @@ IF(NOT QT4_FOUND) ELSE(NOT QT4_FOUND) INCLUDE(${QT_USE_FILE}) - IF(QT_CONFIG MATCHES "static") - SET(CMAKE_QT_IS_STATIC TRUE CACHE STATIC "") - ENDIF(QT_CONFIG MATCHES "static") + SET(CMAKE_PACKAGE_QTGUI TRUE) + # i don't want to install or package the qt gui on windows + # unless qt is static + IF(WIN32 AND NOT QT_CONFIG MATCHES "static") + SET(CMAKE_PACKAGE_QTGUI FALSE) + ENDIF(WIN32 AND NOT QT_CONFIG MATCHES "static") + CONFIGURE_FILE("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in" + "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake") SET(SRCS AddCacheEntry.cxx AddCacheEntry.h @@ -51,12 +56,9 @@ ELSE(NOT QT4_FOUND) TARGET_LINK_LIBRARIES(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES}) # if qt is not static and we are on windows then skip the install # I don't want to distribute qt dlls - IF(WIN32 AND NOT CMAKE_QT_IS_STATIC) - SET(SKIP_INSTALL TRUE) - ENDIF(WIN32 AND NOT CMAKE_QT_IS_STATIC) - IF(NOT SKIP_INSTALL) + IF(CMAKE_PACKAGE_QTGUI) INSTALL_TARGETS(/bin cmake-gui) - ENDIF(NOT SKIP_INSTALL) + ENDIF(CMAKE_PACKAGE_QTGUI) ENDIF(NOT QT4_FOUND) diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in new file mode 100644 index 0000000..24dda01 --- /dev/null +++ b/Source/QtDialog/QtDialogCPack.cmake.in @@ -0,0 +1,4 @@ +SET(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@) +IF(CMAKE_PACKAGE_QTGUI) + SET(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "cmake-gui" "cmake-gui(beta)") +ENDIF(CMAKE_PACKAGE_QTGUI) |