|
11 | 11 | #=============================================================================
|
12 | 12 |
|
13 | 13 | # If the cmake version includes cpack, use it
|
14 |
| -IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") |
15 |
| - IF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") |
16 |
| - OPTION(CMAKE_INSTALL_DEBUG_LIBRARIES |
| 14 | +if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") |
| 15 | + if(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") |
| 16 | + option(CMAKE_INSTALL_DEBUG_LIBRARIES |
17 | 17 | "Install Microsoft runtime debug libraries with CMake." FALSE)
|
18 |
| - MARK_AS_ADVANCED(CMAKE_INSTALL_DEBUG_LIBRARIES) |
| 18 | + mark_as_advanced(CMAKE_INSTALL_DEBUG_LIBRARIES) |
19 | 19 |
|
20 | 20 | # By default, do not warn when built on machines using only VS Express:
|
21 |
| - IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) |
22 |
| - SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) |
23 |
| - ENDIF() |
| 21 | + if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) |
| 22 | + set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) |
| 23 | + endif() |
24 | 24 |
|
25 |
| - INCLUDE(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake) |
26 |
| - ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") |
| 25 | + include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake) |
| 26 | + endif(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") |
27 | 27 |
|
28 |
| - SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool") |
29 |
| - SET(CPACK_PACKAGE_VENDOR "Kitware") |
30 |
| - SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") |
31 |
| - SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") |
32 |
| - SET(CPACK_PACKAGE_VERSION "${CMake_VERSION}") |
33 |
| - SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") |
34 |
| - SET(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}") |
| 28 | + set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool") |
| 29 | + set(CPACK_PACKAGE_VENDOR "Kitware") |
| 30 | + set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") |
| 31 | + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") |
| 32 | + set(CPACK_PACKAGE_VERSION "${CMake_VERSION}") |
| 33 | + set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") |
| 34 | + set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}") |
35 | 35 |
|
36 | 36 | # Make this explicit here, rather than accepting the CPack default value,
|
37 | 37 | # so we can refer to it:
|
38 |
| - SET(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") |
| 38 | + set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") |
39 | 39 |
|
40 | 40 | # Installers for 32- vs. 64-bit CMake:
|
41 | 41 | # - Root install directory (displayed to end user at installer-run time)
|
42 | 42 | # - "NSIS package/display name" (text used in the installer GUI)
|
43 | 43 | # - Registry key used to store info about the installation
|
44 |
| - IF(CMAKE_CL_64) |
45 |
| - SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") |
46 |
| - SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)") |
47 |
| - SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)") |
48 |
| - ELSE() |
49 |
| - SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") |
50 |
| - SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") |
51 |
| - SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") |
52 |
| - ENDIF() |
| 44 | + if(CMAKE_CL_64) |
| 45 | + set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") |
| 46 | + set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)") |
| 47 | + set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)") |
| 48 | + else() |
| 49 | + set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") |
| 50 | + set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") |
| 51 | + set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") |
| 52 | + endif() |
53 | 53 |
|
54 |
| - IF(NOT DEFINED CPACK_SYSTEM_NAME) |
| 54 | + if(NOT DEFINED CPACK_SYSTEM_NAME) |
55 | 55 | # make sure package is not Cygwin-unknown, for Cygwin just
|
56 | 56 | # cygwin is good for the system name
|
57 |
| - IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") |
58 |
| - SET(CPACK_SYSTEM_NAME Cygwin) |
59 |
| - ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") |
60 |
| - SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) |
61 |
| - ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") |
62 |
| - ENDIF(NOT DEFINED CPACK_SYSTEM_NAME) |
63 |
| - IF(${CPACK_SYSTEM_NAME} MATCHES Windows) |
64 |
| - IF(CMAKE_CL_64) |
65 |
| - SET(CPACK_SYSTEM_NAME win64-x64) |
66 |
| - ELSE(CMAKE_CL_64) |
67 |
| - SET(CPACK_SYSTEM_NAME win32-x86) |
68 |
| - ENDIF(CMAKE_CL_64) |
69 |
| - ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows) |
| 57 | + if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") |
| 58 | + set(CPACK_SYSTEM_NAME Cygwin) |
| 59 | + else("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") |
| 60 | + set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) |
| 61 | + endif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") |
| 62 | + endif(NOT DEFINED CPACK_SYSTEM_NAME) |
| 63 | + if(${CPACK_SYSTEM_NAME} MATCHES Windows) |
| 64 | + if(CMAKE_CL_64) |
| 65 | + set(CPACK_SYSTEM_NAME win64-x64) |
| 66 | + else(CMAKE_CL_64) |
| 67 | + set(CPACK_SYSTEM_NAME win32-x86) |
| 68 | + endif(CMAKE_CL_64) |
| 69 | + endif(${CPACK_SYSTEM_NAME} MATCHES Windows) |
70 | 70 |
|
71 |
| - IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) |
| 71 | + if(NOT DEFINED CPACK_PACKAGE_FILE_NAME) |
72 | 72 | # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
|
73 | 73 | # default to source package - system, on cygwin system is not
|
74 | 74 | # needed
|
75 |
| - IF(CYGWIN) |
76 |
| - SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") |
77 |
| - ELSE(CYGWIN) |
78 |
| - SET(CPACK_PACKAGE_FILE_NAME |
| 75 | + if(CYGWIN) |
| 76 | + set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") |
| 77 | + else(CYGWIN) |
| 78 | + set(CPACK_PACKAGE_FILE_NAME |
79 | 79 | "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
|
80 |
| - ENDIF(CYGWIN) |
81 |
| - ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) |
| 80 | + endif(CYGWIN) |
| 81 | + endif(NOT DEFINED CPACK_PACKAGE_FILE_NAME) |
82 | 82 |
|
83 |
| - SET(CPACK_PACKAGE_CONTACT "[email protected]") |
| 83 | + set(CPACK_PACKAGE_CONTACT "[email protected]") |
84 | 84 |
|
85 |
| - IF(UNIX) |
86 |
| - SET(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest") |
87 |
| - SET(CPACK_SOURCE_STRIP_FILES "") |
88 |
| - SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake") |
89 |
| - ENDIF(UNIX) |
| 85 | + if(UNIX) |
| 86 | + set(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest") |
| 87 | + set(CPACK_SOURCE_STRIP_FILES "") |
| 88 | + set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake") |
| 89 | + endif(UNIX) |
90 | 90 |
|
91 | 91 | # cygwin specific packaging stuff
|
92 |
| - IF(CYGWIN) |
| 92 | + if(CYGWIN) |
93 | 93 | # setup the cygwin package name
|
94 |
| - SET(CPACK_PACKAGE_NAME cmake) |
| 94 | + set(CPACK_PACKAGE_NAME cmake) |
95 | 95 | # setup the name of the package for cygwin cmake-2.4.3
|
96 |
| - SET(CPACK_PACKAGE_FILE_NAME |
| 96 | + set(CPACK_PACKAGE_FILE_NAME |
97 | 97 | "${CPACK_PACKAGE_NAME}-${CMake_VERSION}")
|
98 | 98 | # the source has the same name as the binary
|
99 |
| - SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}) |
| 99 | + set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}) |
100 | 100 | # Create a cygwin version number in case there are changes for cygwin
|
101 | 101 | # that are not reflected upstream in CMake
|
102 |
| - SET(CPACK_CYGWIN_PATCH_NUMBER 1) |
| 102 | + set(CPACK_CYGWIN_PATCH_NUMBER 1) |
103 | 103 | # These files are required by the cmCPackCygwinSourceGenerator and the files
|
104 | 104 | # put into the release tar files.
|
105 |
| - SET(CPACK_CYGWIN_BUILD_SCRIPT |
| 105 | + set(CPACK_CYGWIN_BUILD_SCRIPT |
106 | 106 | "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@[email protected]")
|
107 |
| - SET(CPACK_CYGWIN_PATCH_FILE |
| 107 | + set(CPACK_CYGWIN_PATCH_FILE |
108 | 108 | "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@[email protected]")
|
109 | 109 | # include the sub directory cmake file for cygwin that
|
110 | 110 | # configures some files and adds some install targets
|
111 | 111 | # this file uses some of the package file name variables
|
112 |
| - INCLUDE(Utilities/Release/Cygwin/CMakeLists.txt) |
113 |
| - ENDIF(CYGWIN) |
| 112 | + include(Utilities/Release/Cygwin/CMakeLists.txt) |
| 113 | + endif(CYGWIN) |
114 | 114 |
|
115 | 115 | # Set the options file that needs to be included inside CMakeCPackOptions.cmake
|
116 |
| - SET(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake) |
117 |
| - CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in" |
| 116 | + set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake) |
| 117 | + configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in" |
118 | 118 | "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
|
119 |
| - SET(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake") |
| 119 | + set(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake") |
120 | 120 |
|
121 | 121 | # include CPack model once all variables are set
|
122 |
| - INCLUDE(CPack) |
123 |
| -ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") |
| 122 | + include(CPack) |
| 123 | +endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") |
0 commit comments