OpenJPEGCPack.cmake 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # package bundler
  2. if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
  3. if(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
  4. set(CMAKE_INSTALL_MFC_LIBRARIES 0)
  5. set(CMAKE_INSTALL_DEBUG_LIBRARIES 0)
  6. if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
  7. set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
  8. endif()
  9. include(${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake)
  10. endif()
  11. set(OPJ_PACKAGE_DESCRIPTION_SUMMARY "OpenJPEG - OpenJPEG a JPEG 2000 implementation.")
  12. set(OPJ_PACKAGE_CONTACT "openjpeg users <openjpeg@googlegroups.com>")
  13. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${OPJ_PACKAGE_DESCRIPTION_SUMMARY})
  14. set(CPACK_PACKAGE_VENDOR "OpenJPEG Team")
  15. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
  16. "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt" COPYONLY
  17. )
  18. # For PackageMaker on MacOSX it is important to have a file extension:
  19. set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
  20. set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
  21. set(CPACK_PACKAGE_VERSION_MAJOR "${OPENJPEG_VERSION_MAJOR}")
  22. set(CPACK_PACKAGE_VERSION_MINOR "${OPENJPEG_VERSION_MINOR}")
  23. set(CPACK_PACKAGE_VERSION_PATCH "${OPENJPEG_VERSION_BUILD}")
  24. set(CPACK_PACKAGE_INSTALL_DIRECTORY "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
  25. set(CPACK_SOURCE_PACKAGE_FILE_NAME "openjpeg-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
  26. # Make this explicit here, rather than accepting the CPack default value,
  27. # so we can refer to it:
  28. set(CPACK_PACKAGE_NAME "${OPENJPEG_LIBRARY_NAME}")
  29. if(NOT DEFINED CPACK_SYSTEM_NAME)
  30. # make sure package is not Cygwin-unknown, for Cygwin just
  31. # cygwin is good for the system name
  32. if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
  33. set(CPACK_SYSTEM_NAME Cygwin)
  34. else()
  35. set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
  36. endif()
  37. endif()
  38. if(${CPACK_SYSTEM_NAME} MATCHES Windows)
  39. if(CMAKE_CL_64)
  40. set(CPACK_SYSTEM_NAME win64-x64)
  41. else()
  42. set(CPACK_SYSTEM_NAME win32-x86)
  43. endif()
  44. endif()
  45. if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
  46. # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
  47. # default to source package - system, on cygwin system is not
  48. # needed
  49. if(CYGWIN)
  50. set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
  51. else()
  52. set(CPACK_PACKAGE_FILE_NAME
  53. "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
  54. endif()
  55. endif()
  56. set(CPACK_BUNDLE_NAME "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
  57. if(APPLE)
  58. configure_file(${CMAKE_ROOT}/Templates/AppleInfo.plist
  59. ${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
  60. set(CPACK_BUNDLE_PLIST
  61. ${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
  62. #include(BundleUtilities)
  63. endif()
  64. include(CPack)
  65. endiF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")