2016-05-24 19:56:43 +02:00
# cmake file for generating distribution packages
2019-01-19 18:35:40 +01:00
# default packages to build
2017-08-04 22:59:56 +02:00
IF ( APPLE )
2018-12-31 15:48:29 +01:00
SET ( CPACK_GENERATOR "TGZ" "Bundle" )
ELSEIF ( UNIX )
2020-04-20 18:46:51 +02:00
SET ( CPACK_GENERATOR "TGZ" )
2018-12-31 15:48:29 +01:00
ELSEIF ( WIN32 )
2019-01-19 18:35:40 +01:00
SET ( CPACK_GENERATOR "ZIP" )
ENDIF ( )
# Determine packages by found generator executables
find_package ( RpmBuilder )
find_package ( DebBuilder )
IF ( RPM_BUILDER_FOUND )
2019-07-12 16:54:26 +02:00
message ( STATUS "CPACK: Found RPM builder" )
2019-01-19 18:35:40 +01:00
SET ( CPACK_GENERATOR ${ CPACK_GENERATOR } "RPM" )
ENDIF ( )
IF ( DEB_BUILDER_FOUND )
2019-07-12 16:54:26 +02:00
message ( STATUS "CPACK: Found DEB builder" )
2019-01-19 18:35:40 +01:00
SET ( CPACK_GENERATOR ${ CPACK_GENERATOR } "DEB" )
2017-08-04 22:59:56 +02:00
ENDIF ( )
2016-05-24 19:56:43 +02:00
2018-12-31 15:48:29 +01:00
# Apply to all packages, some of these can be overwritten with generator specific content
2019-01-19 18:35:40 +01:00
# https://cmake.org/cmake/help/v3.5/module/CPack.html
2018-12-31 15:48:29 +01:00
2020-02-16 16:24:33 +01:00
SET ( CPACK_PACKAGE_NAME "Hyperion" )
2016-08-20 16:37:45 +02:00
SET ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hyperion is an open source ambient light implementation" )
2016-05-24 19:56:43 +02:00
SET ( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md" )
2019-06-19 19:04:54 +02:00
2020-02-16 16:24:33 +01:00
IF ( NOT DEFINED DOCKER_PLATFORM )
SET ( CPACK_PACKAGE_FILE_NAME "Hyperion-${HYPERION_VERSION}-${CMAKE_SYSTEM_NAME}" )
ELSE ( )
SET ( CPACK_PACKAGE_FILE_NAME "Hyperion-${HYPERION_VERSION}-${CMAKE_SYSTEM_NAME}-${DOCKER_PLATFORM}" )
ENDIF ( )
2019-06-19 19:04:54 +02:00
2018-12-31 15:48:29 +01:00
SET ( CPACK_PACKAGE_CONTACT "packages@hyperion-project.org" )
SET ( CPACK_PACKAGE_EXECUTABLES "hyperiond;Hyperion" )
SET ( CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources/icons/hyperion-icon-32px.png" )
SET ( CPACK_PACKAGE_VERSION_MAJOR "${HYPERION_VERSION_MAJOR}" )
SET ( CPACK_PACKAGE_VERSION_MINOR "${HYPERION_VERSION_MINOR}" )
SET ( CPACK_PACKAGE_VERSION_PATCH "${HYPERION_VERSION_PATCH}" )
2016-05-24 19:56:43 +02:00
SET ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" )
2018-12-31 15:48:29 +01:00
SET ( CPACK_CREATE_DESKTOP_LINKS "hyperiond;Hyperion" )
# Specific CPack Package Generators
# https://cmake.org/Wiki/CMake:CPackPackageGenerators
2019-01-19 18:35:40 +01:00
# .deb files for apt
2016-05-24 19:56:43 +02:00
2018-12-28 18:12:45 +01:00
SET ( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/preinst;${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/postinst;${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/prerm" )
2016-05-24 19:56:43 +02:00
SET ( CPACK_DEBIAN_PACKAGE_SECTION "Miscellaneous" )
2018-12-31 15:48:29 +01:00
# .rpm for rpm
2019-01-19 20:07:22 +01:00
# https://cmake.org/cmake/help/v3.5/module/CPackRPM.html
2018-12-31 15:48:29 +01:00
SET ( CPACK_RPM_PACKAGE_RELEASE 1 )
2019-01-19 18:35:40 +01:00
SET ( CPACK_RPM_PACKAGE_LICENSE "MIT" )
SET ( CPACK_RPM_PACKAGE_GROUP "Applications" )
2020-04-20 18:46:51 +02:00
2019-01-19 18:35:40 +01:00
# Notes: This is a dependency list for Fedora 27, different .rpm OSes use different names for their deps
SET ( CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/rpm/preinst" )
2016-05-24 19:56:43 +02:00
SET ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/rpm/postinst" )
2019-01-19 18:35:40 +01:00
SET ( CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/rpm/prerm" )
2016-05-24 19:56:43 +02:00
2018-12-31 15:48:29 +01:00
# OSX "Bundle" generator TODO Add more osx generators
# https://cmake.org/cmake/help/v3.10/module/CPackBundle.html
2017-08-04 22:59:56 +02:00
SET ( CPACK_BUNDLE_NAME "Hyperion" )
2018-12-31 15:48:29 +01:00
SET ( CPACK_BUNDLE_ICON ${ CMAKE_CURRENT_SOURCE_DIR } /cmake/osxbundle/Hyperion.icns )
SET ( CPACK_BUNDLE_PLIST ${ CMAKE_CURRENT_SOURCE_DIR } /cmake/osxbundle/Info.plist )
SET ( CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_SOURCE_DIR}/cmake/osxbundle/launch.sh" )
2017-08-04 22:59:56 +02:00
2018-12-31 15:48:29 +01:00
# NSIS for windows, requires NSIS TODO finish
SET ( CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/cmake/nsis/installer.ico" )
SET ( CPACK_NSIS_MUI_UNIICON "${CMAKE_CURRENT_SOURCE_DIR}/cmake/nsis/uninstaller.ico" )
#SET ( CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/cmake/nsis/installer.bmp") #bmp required? If so, wrap in WIN32 check else: Use default icon instead
SET ( CPACK_NSIS_MODIFY_PATH ON )
SET ( CPACK_NSIS_DISPLAY_NAME "Hyperion Installer" )
SET ( CPACK_NSIS_INSTALLED_ICON_NAME "Link to .exe" )
SET ( CPACK_NSIS_HELP_LINK "https://www.hyperion-project.org" )
SET ( CPACK_NSIS_URL_INFO_ABOUT "https://www.hyperion-project.org" )
2016-05-24 19:56:43 +02:00
2018-12-31 15:48:29 +01:00
# define the install components
2016-08-20 16:37:45 +02:00
SET ( CPACK_COMPONENTS_ALL "${PLATFORM}" )
2020-02-16 16:24:33 +01:00
SET ( CPACK_COMPONENT_ ${ PLATFORM } _ARCHIVE_FILE "${CPACK_PACKAGE_FILE_NAME}" )
2016-05-24 19:56:43 +02:00
SET ( CPACK_ARCHIVE_COMPONENT_INSTALL ON )
2020-02-16 16:24:33 +01:00
SET ( CPACK_DEBIAN_ ${ PLATFORM } _FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.deb" )
2016-05-24 19:56:43 +02:00
SET ( CPACK_DEB_COMPONENT_INSTALL ON )
2020-02-16 16:24:33 +01:00
SET ( CPACK_RPM_ ${ PLATFORM } _FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.rpm" )
2016-05-24 19:56:43 +02:00
SET ( CPACK_RPM_COMPONENT_INSTALL ON )
2020-02-16 16:24:33 +01:00
2016-05-24 19:56:43 +02:00
SET ( CPACK_STRIP_FILES ON )
# no code after following line!
INCLUDE ( CPack )