2011-12-02 15:52:34 +01:00
|
|
|
# package bundler
|
|
|
|
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
|
|
|
if(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
|
|
|
|
set(CMAKE_INSTALL_MFC_LIBRARIES 0)
|
|
|
|
set(CMAKE_INSTALL_DEBUG_LIBRARIES 0)
|
2012-02-13 12:20:26 +01:00
|
|
|
if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
|
|
|
|
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
|
|
|
|
endif()
|
2011-12-02 15:52:34 +01:00
|
|
|
include(${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake)
|
2012-08-30 19:20:03 +02:00
|
|
|
endif()
|
2011-12-02 15:52:34 +01:00
|
|
|
|
|
|
|
set(OPJ_PACKAGE_DESCRIPTION_SUMMARY "OpenJPEG - OpenJPEG a JPEG 2000 implementation.")
|
|
|
|
set(OPJ_PACKAGE_CONTACT "openjpeg users <openjpeg@googlegroups.com>")
|
|
|
|
|
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${OPJ_PACKAGE_DESCRIPTION_SUMMARY})
|
2012-02-13 12:20:26 +01:00
|
|
|
set(CPACK_PACKAGE_VENDOR "OpenJPEG Team")
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt" COPYONLY
|
|
|
|
)
|
|
|
|
# For PackageMaker on MacOSX it is important to have a file extension:
|
2016-05-15 02:09:54 +02:00
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
|
|
|
|
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
|
2011-12-02 15:52:34 +01:00
|
|
|
set(CPACK_PACKAGE_VERSION_MAJOR "${OPENJPEG_VERSION_MAJOR}")
|
|
|
|
set(CPACK_PACKAGE_VERSION_MINOR "${OPENJPEG_VERSION_MINOR}")
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH "${OPENJPEG_VERSION_BUILD}")
|
|
|
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
|
|
|
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME "openjpeg-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
|
|
|
|
2012-02-13 12:20:26 +01:00
|
|
|
# Make this explicit here, rather than accepting the CPack default value,
|
|
|
|
# so we can refer to it:
|
2012-08-30 19:14:39 +02:00
|
|
|
set(CPACK_PACKAGE_NAME "${OPENJPEG_LIBRARY_NAME}")
|
2012-02-13 12:20:26 +01:00
|
|
|
|
2012-08-30 19:14:39 +02:00
|
|
|
if(NOT DEFINED CPACK_SYSTEM_NAME)
|
2012-02-13 12:20:26 +01:00
|
|
|
# make sure package is not Cygwin-unknown, for Cygwin just
|
|
|
|
# cygwin is good for the system name
|
2012-08-30 19:14:39 +02:00
|
|
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
|
|
|
set(CPACK_SYSTEM_NAME Cygwin)
|
2012-08-30 19:20:03 +02:00
|
|
|
else()
|
2012-08-30 19:14:39 +02:00
|
|
|
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
|
2012-08-30 19:20:03 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
2012-08-30 19:14:39 +02:00
|
|
|
if(${CPACK_SYSTEM_NAME} MATCHES Windows)
|
|
|
|
if(CMAKE_CL_64)
|
|
|
|
set(CPACK_SYSTEM_NAME win64-x64)
|
2012-08-30 19:20:03 +02:00
|
|
|
else()
|
2012-08-30 19:14:39 +02:00
|
|
|
set(CPACK_SYSTEM_NAME win32-x86)
|
2012-08-30 19:20:03 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
2012-02-13 12:20:26 +01:00
|
|
|
|
2012-08-30 19:14:39 +02:00
|
|
|
if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
|
2012-02-13 12:20:26 +01:00
|
|
|
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
|
2012-08-30 19:20:03 +02:00
|
|
|
# default to source package - system, on cygwin system is not
|
2012-02-13 12:20:26 +01:00
|
|
|
# needed
|
2012-08-30 19:14:39 +02:00
|
|
|
if(CYGWIN)
|
|
|
|
set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
|
2012-08-30 19:20:03 +02:00
|
|
|
else()
|
|
|
|
set(CPACK_PACKAGE_FILE_NAME
|
2012-02-13 12:20:26 +01:00
|
|
|
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
|
2012-08-30 19:20:03 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
2012-02-13 12:20:26 +01:00
|
|
|
|
|
|
|
set(CPACK_BUNDLE_NAME "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
|
2012-10-01 16:18:20 +02:00
|
|
|
if(APPLE)
|
|
|
|
configure_file(${CMAKE_ROOT}/Templates/AppleInfo.plist
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
|
|
|
|
set(CPACK_BUNDLE_PLIST
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
|
|
|
|
#include(BundleUtilities)
|
|
|
|
endif()
|
2012-02-13 12:20:26 +01:00
|
|
|
|
2011-12-02 15:52:34 +01:00
|
|
|
include(CPack)
|
|
|
|
endiF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|