My CMake modules, scripts, templates
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CPackCommonRules.cmake 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. INCLUDE (CPackDetectArch)
  2. ## CPack configuration ##
  3. SET (CPACK_PACKAGE_CONTACT "${CONTACT}")
  4. SET (CPACK_PACKAGE_VENDOR "${CONTACT}")
  5. SET (CPACK_NSIS_MODIFY_PATH ON)
  6. SET (CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
  7. INCLUDE (InstallRequiredSystemLibraries)
  8. SET (CPACK_RESOURCE_FILE_LICENSE
  9. "${CMAKE_SOURCE_DIR}/COPYING")
  10. SET (CPACK_PACKAGE_DESCRIPTION_FILE
  11. "${CMAKE_SOURCE_DIR}/README")
  12. SET (pkgconfig_file "${PROJECT_BINARY_DIR}/pkg-config/${PROJECT_LOWERCASE_NAME}-${MAJOR}.pc")
  13. IF (EXISTS ${pkgconfig_file})
  14. SET (lib "lib")
  15. IF (UNIX)
  16. IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
  17. SET (lib "lib64")
  18. ENDIF()
  19. ENDIF(UNIX)
  20. INSTALL (FILES ${pkgconfig_file} DESTINATION ${lib}/pkgconfig)
  21. ENDIF ()
  22. #SET (CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME}")
  23. #SET (CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME}")
  24. SET (CPACK_PACKAGE_VERSION_MAJOR "${MAJOR}")
  25. SET (CPACK_PACKAGE_VERSION_MINOR "${MINOR}")
  26. SET (CPACK_PACKAGE_VERSION_PATCH "${PATCH}")
  27. SET (CPACK_PACKAGE_VERSION "${MAJOR}.${MINOR}.${PATCH}")
  28. IF (UNIX)
  29. SET (CPACK_GENERATOR "DEB;RPM;STGZ;TBZ2;TGZ;TZ;ZIP")
  30. SET (CPACK_SOURCE_GENERATOR "DEB;RPM;STGZ;TBZ2;TGZ;TZ;ZIP")
  31. SET (CPACK_PACKAGE_NAME "${PROJECT_LOWERCASE_NAME}")
  32. SET (CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
  33. SET (CPACK_PACKAGE_DESCRIPTION "${PROJECT_DESCRIPTION}")
  34. # Debian specific options
  35. SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${DEBIAN_DEPENDENCIES}")
  36. SET (CPACK_DEBIAN_PACKAGE_SECTION "${DEBIAN_SECTION}")
  37. # SET (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${ARCHITECTURE}")
  38. # SET (CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
  39. SET (CPACK_DEBIAN_PACKAGE_RECOMMENDS "")
  40. SET (CPACK_DEBIAN_PACKAGE_SUGGESTS "")
  41. # RPM specific options
  42. # SET (CPACK_RPM_PACKAGE_ARCHITECTURE "${ARCHITECTURE}")
  43. SET (CPACK_RPM_PACKAGE_LICENSE "${LICENSE}")
  44. SET (CPACK_RPM_PACKAGE_GROUP "${REDHAT_SECTION}")
  45. SET (CPACK_RPM_PACKAGE_REQUIRES "${REDHAT_DEPENDENCIES}")
  46. SET (CPACK_RPM_PACKAGE_PROVIDES "${PROJECT_LOWERCASE_NAME}")
  47. # http://public.kitware.com/Bug/view.php?id=12997
  48. SET(CPACK_PACKAGE_FILE_NAME
  49. "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${ARCHITECTURE}")
  50. ELSEIF (WIN32)
  51. SET (CPACK_GENERATOR "NSIS")
  52. SET (CPACK_SOURCE_GENERATOR "NSIS")
  53. SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CMAKE_PROJECT_NAME}-${MAJOR}")
  54. #SET (CPACK_NSIS_MENU_LINKS "${EWS_WEBSITE}" "Homepage for ${EWS_APP_NAME}")
  55. #SET (CPACK_NSIS_INSTALLED_ICON_NAME bin\\\\${EXE_TARGET_NAME}.exe)
  56. #SET (CPACK_NSIS_URL_INFO_ABOUT "${EWS_WEBSITE}")
  57. #SET (CPACK_NSIS_HELP_LINK "${EWS_WEBSITE}")
  58. SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}-${MAJOR}")
  59. SET (CPACK_UNINSTALL_NAME "${WIN32_UNINSTALL_NAME}-${MAJOR}") # <=10 symbols: https://redmine.backbone.ws/issues/83
  60. ENDIF ()
  61. INCLUDE (CPack)