CMakeCPack.cmake 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. SET(CMAKE_INSTALL_MFC_LIBRARIES 1)
  16. OPTION(CMAKE_INSTALL_DEBUG_LIBRARIES
  17. "Install Microsoft runtime debug libraries with CMake." FALSE)
  18. MARK_AS_ADVANCED(CMAKE_INSTALL_DEBUG_LIBRARIES)
  19. INCLUDE(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
  20. ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
  21. # Set the options file that needs to be included inside CMakeCPackOptions.cmake
  22. SET(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
  23. CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
  24. "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
  25. SET(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
  26. SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
  27. SET(CPACK_PACKAGE_VENDOR "Kitware")
  28. SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
  29. SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
  30. SET(CPACK_PACKAGE_VERSION_MAJOR "${CMake_VERSION_MAJOR}")
  31. SET(CPACK_PACKAGE_VERSION_MINOR "${CMake_VERSION_MINOR}")
  32. SET(CPACK_PACKAGE_VERSION_PATCH "${CMake_VERSION_PATCH}")
  33. SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
  34. SET(CPACK_SOURCE_PACKAGE_FILE_NAME
  35. "cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
  36. IF(CMake_VERSION_RC)
  37. SET(CPACK_SOURCE_PACKAGE_FILE_NAME
  38. "${CPACK_SOURCE_PACKAGE_FILE_NAME}-rc${CMake_VERSION_RC}")
  39. ENDIF(CMake_VERSION_RC)
  40. IF(NOT DEFINED CPACK_SYSTEM_NAME)
  41. # make sure package is not Cygwin-unknown, for Cygwin just
  42. # cygwin is good for the system name
  43. IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
  44. SET(CPACK_SYSTEM_NAME Cygwin)
  45. ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
  46. SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
  47. ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
  48. ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
  49. IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
  50. IF(CMAKE_CL_64)
  51. SET(CPACK_SYSTEM_NAME win64-${CMAKE_SYSTEM_PROCESSOR})
  52. ELSE(CMAKE_CL_64)
  53. SET(CPACK_SYSTEM_NAME win32-${CMAKE_SYSTEM_PROCESSOR})
  54. ENDIF(CMAKE_CL_64)
  55. ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
  56. IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
  57. # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
  58. # default to source package - system, on cygwin system is not
  59. # needed
  60. IF(CYGWIN)
  61. SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
  62. ELSE(CYGWIN)
  63. SET(CPACK_PACKAGE_FILE_NAME
  64. "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
  65. ENDIF(CYGWIN)
  66. ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
  67. SET(CPACK_PACKAGE_CONTACT "[email protected]")
  68. IF(UNIX)
  69. SET(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
  70. SET(CPACK_SOURCE_STRIP_FILES "")
  71. SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
  72. ENDIF(UNIX)
  73. # cygwin specific packaging stuff
  74. IF(CYGWIN)
  75. # if we are on cygwin and have cpack, then force the
  76. # doc, data and man dirs to conform to cygwin style directories
  77. SET(CMAKE_DOC_DIR "/share/doc/${CPACK_PACKAGE_FILE_NAME}")
  78. SET(CMAKE_DATA_DIR "/share/${CPACK_PACKAGE_FILE_NAME}")
  79. SET(CMAKE_MAN_DIR "/share/man")
  80. # let the user know we just forced these values
  81. MESSAGE(STATUS "Setup for Cygwin packaging")
  82. MESSAGE(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
  83. MESSAGE(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
  84. MESSAGE(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
  85. # setup the cygwin package name
  86. SET(CPACK_PACKAGE_NAME cmake)
  87. # setup the name of the package for cygwin cmake-2.4.3
  88. SET(CPACK_PACKAGE_FILE_NAME
  89. "${CPACK_PACKAGE_NAME}-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
  90. # the source has the same name as the binary
  91. SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
  92. # Create a cygwin version number in case there are changes for cygwin
  93. # that are not reflected upstream in CMake
  94. SET(CPACK_CYGWIN_PATCH_NUMBER 1)
  95. # These files are required by the cmCPackCygwinSourceGenerator and the files
  96. # put into the release tar files.
  97. SET(CPACK_CYGWIN_BUILD_SCRIPT
  98. "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@[email protected]")
  99. SET(CPACK_CYGWIN_PATCH_FILE
  100. "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@[email protected]")
  101. # include the sub directory cmake file for cygwin that
  102. # configures some files and adds some install targets
  103. # this file uses some of the package file name variables
  104. INCLUDE(Utilities/Release/Cygwin/CMakeLists.txt)
  105. ENDIF(CYGWIN)
  106. # include CPack model once all variables are set
  107. INCLUDE(CPack)
  108. ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")