CMakeCPack.cmake 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. INCLUDE(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
  19. ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
  20. # Set the options file that needs to be included inside CMakeCPackOptions.cmake
  21. SET(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
  22. CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
  23. "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
  24. SET(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
  25. SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
  26. SET(CPACK_PACKAGE_VENDOR "Kitware")
  27. SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
  28. SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
  29. SET(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
  30. SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
  31. SET(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
  32. IF(NOT DEFINED CPACK_SYSTEM_NAME)
  33. # make sure package is not Cygwin-unknown, for Cygwin just
  34. # cygwin is good for the system name
  35. IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
  36. SET(CPACK_SYSTEM_NAME Cygwin)
  37. ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
  38. SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
  39. ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
  40. ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
  41. IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
  42. IF(CMAKE_CL_64)
  43. SET(CPACK_SYSTEM_NAME win64-${CMAKE_SYSTEM_PROCESSOR})
  44. ELSE(CMAKE_CL_64)
  45. SET(CPACK_SYSTEM_NAME win32-${CMAKE_SYSTEM_PROCESSOR})
  46. ENDIF(CMAKE_CL_64)
  47. ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
  48. IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
  49. # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
  50. # default to source package - system, on cygwin system is not
  51. # needed
  52. IF(CYGWIN)
  53. SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
  54. ELSE(CYGWIN)
  55. SET(CPACK_PACKAGE_FILE_NAME
  56. "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
  57. ENDIF(CYGWIN)
  58. ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
  59. SET(CPACK_PACKAGE_CONTACT "[email protected]")
  60. IF(UNIX)
  61. SET(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
  62. SET(CPACK_SOURCE_STRIP_FILES "")
  63. SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
  64. ENDIF(UNIX)
  65. # cygwin specific packaging stuff
  66. IF(CYGWIN)
  67. # setup the cygwin package name
  68. SET(CPACK_PACKAGE_NAME cmake)
  69. # setup the name of the package for cygwin cmake-2.4.3
  70. SET(CPACK_PACKAGE_FILE_NAME
  71. "${CPACK_PACKAGE_NAME}-${CMake_VERSION}")
  72. # the source has the same name as the binary
  73. SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
  74. # Create a cygwin version number in case there are changes for cygwin
  75. # that are not reflected upstream in CMake
  76. SET(CPACK_CYGWIN_PATCH_NUMBER 1)
  77. # These files are required by the cmCPackCygwinSourceGenerator and the files
  78. # put into the release tar files.
  79. SET(CPACK_CYGWIN_BUILD_SCRIPT
  80. "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@[email protected]")
  81. SET(CPACK_CYGWIN_PATCH_FILE
  82. "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@[email protected]")
  83. # include the sub directory cmake file for cygwin that
  84. # configures some files and adds some install targets
  85. # this file uses some of the package file name variables
  86. INCLUDE(Utilities/Release/Cygwin/CMakeLists.txt)
  87. ENDIF(CYGWIN)
  88. # include CPack model once all variables are set
  89. INCLUDE(CPack)
  90. ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")