CMakeCPack.cmake 5.5 KB

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