2009-10-02 01:21:28 +04:00
|
|
|
#=============================================================================
|
|
|
|
# CMake - Cross Platform Makefile Generator
|
|
|
|
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
|
|
|
|
2007-05-10 22:08:15 +04:00
|
|
|
# If the cmake version includes cpack, use it
|
|
|
|
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
|
|
|
IF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
|
2007-11-07 21:11:58 +03:00
|
|
|
OPTION(CMAKE_INSTALL_DEBUG_LIBRARIES
|
|
|
|
"Install Microsoft runtime debug libraries with CMake." FALSE)
|
|
|
|
MARK_AS_ADVANCED(CMAKE_INSTALL_DEBUG_LIBRARIES)
|
|
|
|
INCLUDE(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
|
2007-05-10 22:08:15 +04:00
|
|
|
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
|
2008-02-09 17:53:52 +03:00
|
|
|
# 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)
|
2007-10-31 19:55:04 +03:00
|
|
|
CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
|
|
|
|
"${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
|
|
|
|
SET(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
|
2007-05-10 22:08:15 +04:00
|
|
|
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
|
|
|
|
SET(CPACK_PACKAGE_VENDOR "Kitware")
|
|
|
|
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
|
|
|
|
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
|
|
|
|
SET(CPACK_PACKAGE_VERSION_MAJOR "${CMake_VERSION_MAJOR}")
|
|
|
|
SET(CPACK_PACKAGE_VERSION_MINOR "${CMake_VERSION_MINOR}")
|
2009-03-05 23:17:07 +03:00
|
|
|
SET(CPACK_PACKAGE_VERSION_PATCH "${CMake_VERSION_PATCH}")
|
2007-05-10 22:08:15 +04:00
|
|
|
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
|
|
|
|
SET(CPACK_SOURCE_PACKAGE_FILE_NAME
|
2009-03-05 23:17:07 +03:00
|
|
|
"cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
|
2007-05-10 22:08:15 +04:00
|
|
|
IF(CMake_VERSION_RC)
|
|
|
|
SET(CPACK_SOURCE_PACKAGE_FILE_NAME
|
2009-03-05 23:17:07 +03:00
|
|
|
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-rc${CMake_VERSION_RC}")
|
2007-05-10 22:08:15 +04:00
|
|
|
ENDIF(CMake_VERSION_RC)
|
|
|
|
IF(NOT DEFINED CPACK_SYSTEM_NAME)
|
2008-05-20 20:35:38 +04:00
|
|
|
# make sure package is not Cygwin-unknown, for Cygwin just
|
|
|
|
# cygwin is good for the system name
|
|
|
|
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
|
|
|
SET(CPACK_SYSTEM_NAME Cygwin)
|
|
|
|
ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
|
|
|
SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
|
|
|
|
ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
2007-05-10 22:08:15 +04:00
|
|
|
ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
|
|
|
|
IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
|
|
|
|
IF(CMAKE_CL_64)
|
|
|
|
SET(CPACK_SYSTEM_NAME win64-${CMAKE_SYSTEM_PROCESSOR})
|
|
|
|
ELSE(CMAKE_CL_64)
|
|
|
|
SET(CPACK_SYSTEM_NAME win32-${CMAKE_SYSTEM_PROCESSOR})
|
|
|
|
ENDIF(CMAKE_CL_64)
|
|
|
|
ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
|
|
|
|
IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
|
2008-05-23 19:47:43 +04:00
|
|
|
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
|
|
|
|
# default to source package - system, on cygwin system is not
|
|
|
|
# needed
|
|
|
|
IF(CYGWIN)
|
|
|
|
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
|
|
|
|
ELSE(CYGWIN)
|
|
|
|
SET(CPACK_PACKAGE_FILE_NAME
|
|
|
|
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
|
|
|
|
ENDIF(CYGWIN)
|
2007-05-10 22:08:15 +04:00
|
|
|
ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
|
2007-07-27 16:59:59 +04:00
|
|
|
SET(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
|
2007-10-31 06:02:43 +03:00
|
|
|
IF(UNIX)
|
2007-05-10 22:08:15 +04:00
|
|
|
SET(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
|
|
|
|
SET(CPACK_SOURCE_STRIP_FILES "")
|
|
|
|
SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
|
2007-10-31 06:02:43 +03:00
|
|
|
ENDIF(UNIX)
|
2007-05-10 22:08:15 +04:00
|
|
|
# cygwin specific packaging stuff
|
|
|
|
IF(CYGWIN)
|
2008-05-20 20:35:38 +04:00
|
|
|
|
2007-05-10 22:08:15 +04:00
|
|
|
# if we are on cygwin and have cpack, then force the
|
|
|
|
# doc, data and man dirs to conform to cygwin style directories
|
|
|
|
SET(CMAKE_DOC_DIR "/share/doc/${CPACK_PACKAGE_FILE_NAME}")
|
|
|
|
SET(CMAKE_DATA_DIR "/share/${CPACK_PACKAGE_FILE_NAME}")
|
|
|
|
SET(CMAKE_MAN_DIR "/share/man")
|
|
|
|
# let the user know we just forced these values
|
|
|
|
MESSAGE(STATUS "Setup for Cygwin packaging")
|
|
|
|
MESSAGE(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
|
|
|
|
MESSAGE(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
|
|
|
|
MESSAGE(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
|
2007-10-31 06:02:43 +03:00
|
|
|
|
|
|
|
# setup the cygwin package name
|
|
|
|
SET(CPACK_PACKAGE_NAME cmake)
|
|
|
|
# setup the name of the package for cygwin cmake-2.4.3
|
|
|
|
SET(CPACK_PACKAGE_FILE_NAME
|
2009-03-05 23:17:07 +03:00
|
|
|
"${CPACK_PACKAGE_NAME}-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
|
2007-10-31 06:02:43 +03:00
|
|
|
# the source has the same name as the binary
|
|
|
|
SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
|
|
|
|
# Create a cygwin version number in case there are changes for cygwin
|
|
|
|
# that are not reflected upstream in CMake
|
|
|
|
SET(CPACK_CYGWIN_PATCH_NUMBER 1)
|
2007-05-10 22:08:15 +04:00
|
|
|
# These files are required by the cmCPackCygwinSourceGenerator and the files
|
|
|
|
# put into the release tar files.
|
|
|
|
SET(CPACK_CYGWIN_BUILD_SCRIPT
|
|
|
|
"${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.sh")
|
|
|
|
SET(CPACK_CYGWIN_PATCH_FILE
|
|
|
|
"${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.patch")
|
2007-10-31 06:02:43 +03:00
|
|
|
# include the sub directory cmake file for cygwin that
|
|
|
|
# configures some files and adds some install targets
|
|
|
|
# this file uses some of the package file name variables
|
2007-10-30 17:16:24 +03:00
|
|
|
INCLUDE(Utilities/Release/Cygwin/CMakeLists.txt)
|
2007-05-10 22:08:15 +04:00
|
|
|
ENDIF(CYGWIN)
|
|
|
|
# include CPack model once all variables are set
|
|
|
|
INCLUDE(CPack)
|
|
|
|
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|