ENH: make it so cmake-gui only installs if qt is static on windows

This commit is contained in:
Bill Hoffman 2008-02-09 09:53:52 -05:00
parent 445f47473c
commit f6014938cb
4 changed files with 20 additions and 15 deletions

View File

@ -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")

View File

@ -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

View File

@ -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)

View File

@ -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)