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)
|
2020-05-27 22:31:57 +02:00
|
|
|
SET ( CPACK_GENERATOR "TGZ")
|
2018-12-31 15:48:29 +01:00
|
|
|
ELSEIF (UNIX)
|
2020-04-20 18:46:51 +02:00
|
|
|
SET ( CPACK_GENERATOR "TGZ")
|
2018-12-31 15:48:29 +01:00
|
|
|
ELSEIF (WIN32)
|
2020-05-12 19:51:19 +02:00
|
|
|
SET ( CPACK_GENERATOR "ZIP" "NSIS")
|
2019-01-19 18:35:40 +01:00
|
|
|
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
|
|
|
|
2020-05-27 22:31:57 +02:00
|
|
|
# Overwrite CMAKE_SYSTEM_NAME for mac (visual)
|
2020-05-12 19:51:19 +02:00
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
|
if(${CMAKE_HOST_APPLE})
|
|
|
|
set(CMAKE_SYSTEM_NAME "macOS")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
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" )
|
2020-05-12 19:51:19 +02:00
|
|
|
SET ( CPACK_PACKAGE_FILE_NAME "Hyperion-${HYPERION_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
2019-06-19 19:04:54 +02:00
|
|
|
|
2018-12-31 15:48:29 +01:00
|
|
|
SET ( CPACK_PACKAGE_CONTACT "packages@hyperion-project.org")
|
2020-05-12 19:51:19 +02:00
|
|
|
SET ( CPACK_PACKAGE_VENDOR "hyperion-project")
|
2018-12-31 15:48:29 +01:00
|
|
|
SET ( CPACK_PACKAGE_EXECUTABLES "hyperiond;Hyperion" )
|
2020-05-12 19:51:19 +02:00
|
|
|
SET ( CPACK_PACKAGE_INSTALL_DIRECTORY "Hyperion" )
|
2018-12-31 15:48:29 +01:00
|
|
|
SET ( CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources/icons/hyperion-icon-32px.png")
|
2020-05-12 19:51:19 +02:00
|
|
|
|
2018-12-31 15:48:29 +01:00
|
|
|
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" )
|
2020-05-12 19:51:19 +02:00
|
|
|
SET ( CPACK_PACKAGE_EXECUTABLES "hyperiond;Hyperion" )
|
2018-12-31 15:48:29 +01:00
|
|
|
SET ( CPACK_CREATE_DESKTOP_LINKS "hyperiond;Hyperion" )
|
|
|
|
|
2020-05-12 19:51:19 +02:00
|
|
|
# Define the install prefix path for cpack
|
|
|
|
IF ( UNIX )
|
|
|
|
#SET ( CPACK_PACKAGING_INSTALL_PREFIX "share/hyperion")
|
|
|
|
ENDIF()
|
|
|
|
|
2018-12-31 15:48:29 +01:00
|
|
|
# Specific CPack Package Generators
|
|
|
|
# https://cmake.org/Wiki/CMake:CPackPackageGenerators
|
2019-01-19 18:35:40 +01:00
|
|
|
# .deb files for apt
|
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" )
|
2020-09-15 20:49:54 +02:00
|
|
|
SET ( CPACK_DEBIAN_PACKAGE_DEPENDS "libcec4" )
|
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
|
2020-09-15 20:49:54 +02:00
|
|
|
SET ( CPACK_RPM_PACKAGE_RELEASE 1 )
|
|
|
|
SET ( CPACK_RPM_PACKAGE_LICENSE "MIT" )
|
|
|
|
SET ( CPACK_RPM_PACKAGE_GROUP "Applications" )
|
|
|
|
SET ( CPACK_RPM_PACKAGE_REQUIRES "libcec4" )
|
2019-01-19 18:35:40 +01:00
|
|
|
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
|
|
|
|
2020-05-12 19:51:19 +02:00
|
|
|
# Windows NSIS
|
|
|
|
# Use custom script based on cpack nsis template
|
|
|
|
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/nsis/template ${CMAKE_MODULE_PATH})
|
|
|
|
# Some path transformations
|
|
|
|
if(WIN32)
|
|
|
|
file(TO_NATIVE_PATH ${CPACK_PACKAGE_ICON} CPACK_PACKAGE_ICON)
|
|
|
|
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" CPACK_PACKAGE_ICON ${CPACK_PACKAGE_ICON})
|
|
|
|
endif()
|
|
|
|
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/nsis/installer.ico" NSIS_HYP_ICO)
|
|
|
|
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/nsis/hyperion-logo.bmp" NSIS_HYP_LOGO_HORI)
|
|
|
|
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/nsis/hyperion-logo-vert.bmp" NSIS_HYP_LOGO_VERT)
|
|
|
|
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" NSIS_HYP_ICO "${NSIS_HYP_ICO}")
|
|
|
|
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" NSIS_HYP_LOGO_VERT "${NSIS_HYP_LOGO_VERT}")
|
|
|
|
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" NSIS_HYP_LOGO_HORI "${NSIS_HYP_LOGO_HORI}")
|
|
|
|
|
|
|
|
SET ( CPACK_NSIS_MODIFY_PATH ON )
|
|
|
|
SET ( CPACK_NSIS_MUI_ICON ${NSIS_HYP_ICO})
|
|
|
|
SET ( CPACK_NSIS_MUI_UNIICON ${NSIS_HYP_ICO})
|
|
|
|
SET ( CPACK_NSIS_MUI_HEADERIMAGE ${NSIS_HYP_LOGO_HORI} )
|
|
|
|
SET ( CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP ${NSIS_HYP_LOGO_VERT})
|
|
|
|
SET ( CPACK_NSIS_DISPLAY_NAME "Hyperion Ambient Light")
|
|
|
|
SET ( CPACK_NSIS_PACKAGE_NAME "Hyperion" )
|
|
|
|
SET ( CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\hyperiond.exe")
|
2018-12-31 15:48:29 +01:00
|
|
|
SET ( CPACK_NSIS_HELP_LINK "https://www.hyperion-project.org")
|
|
|
|
SET ( CPACK_NSIS_URL_INFO_ABOUT "https://www.hyperion-project.org")
|
2020-07-14 09:10:35 +02:00
|
|
|
SET ( CPACK_NSIS_MUI_FINISHPAGE_RUN "hyperiond.exe")
|
2020-08-01 17:50:20 +02:00
|
|
|
SET ( CPACK_NSIS_BRANDING_TEXT "Hyperion-${HYPERION_VERSION}")
|
2020-07-12 09:18:40 +02:00
|
|
|
# additional hyperiond startmenu link, won't be created if the user disables startmenu links
|
|
|
|
SET ( CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Hyperion (Console).lnk' '$INSTDIR\\\\bin\\\\hyperiond.exe' '-d -c'")
|
2020-07-13 20:59:13 +02:00
|
|
|
SET ( CPACK_NSIS_DELETE_ICONS_EXTRA "Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Hyperion (Console).lnk'")
|
2020-07-12 09:18:40 +02:00
|
|
|
|
|
|
|
|
2020-05-12 19:51:19 +02:00
|
|
|
#SET ( CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Hyperion.lnk' '$INSTDIR\\\\bin\\\\hyperiond.exe'")
|
|
|
|
#SET ( CPACK_NSIS_DELETE_ICONS_EXTRA "Delete '$SMPROGRAMS\\\\$START_MENU\\\\Hyperion.lnk'")
|
|
|
|
# hyperiond desktop link
|
|
|
|
#SET ( CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$DESKTOP\\\\Hyperion.lnk' '$INSTDIR\\\\bin\\\\hyperiond.exe' ")
|
|
|
|
#SET ( CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "Delete '$DESKTOP\\\\Hyperion.lnk' ")
|
|
|
|
#SET ( CPACK_NSIS_EXTRA_INSTALL_COMMANDS "CreateShortCut \\\"$DESKTOP\\\\Hyperion.lnk\\\" \\\"$INSTDIR\\\\bin\\\\hyperiond.exe\\\" ")
|
|
|
|
#SET ( CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "Delete \\\"$DESKTOP\\\\Hyperion.lnk\\\" ")
|
2016-05-24 19:56:43 +02:00
|
|
|
|
2018-12-31 15:48:29 +01:00
|
|
|
# define the install components
|
2020-05-12 19:51:19 +02:00
|
|
|
# See also https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/Component-Install-With-CPack
|
|
|
|
# and https://cmake.org/cmake/help/latest/module/CPackComponent.html
|
|
|
|
SET ( CPACK_COMPONENTS_GROUPING "ALL_COMPONENTS_IN_ONE")
|
|
|
|
# Components base
|
|
|
|
SET ( CPACK_COMPONENTS_ALL "Hyperion" "hyperion_remote" )
|
|
|
|
# optional compiled
|
|
|
|
if(ENABLE_QT)
|
|
|
|
SET ( CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} "hyperion_qt" )
|
|
|
|
endif()
|
|
|
|
if(ENABLE_AMLOGIC)
|
|
|
|
SET ( CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} "hyperion_aml" )
|
|
|
|
endif()
|
|
|
|
if(ENABLE_V4L2)
|
|
|
|
SET ( CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} "hyperion_v4l2" )
|
|
|
|
endif()
|
|
|
|
if(ENABLE_X11)
|
|
|
|
SET ( CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} "hyperion_x11" )
|
|
|
|
endif()
|
2020-08-03 12:31:39 +02:00
|
|
|
if(ENABLE_XCB)
|
|
|
|
SET ( CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} "hyperion_xcb" )
|
|
|
|
endif()
|
2020-05-12 19:51:19 +02:00
|
|
|
if(ENABLE_DISPMANX)
|
|
|
|
SET ( CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} "hyperion_dispmanx" )
|
|
|
|
endif()
|
|
|
|
if(ENABLE_FB)
|
|
|
|
SET ( CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} "hyperion_framebuffer" )
|
|
|
|
endif()
|
|
|
|
if(ENABLE_OSX)
|
|
|
|
SET ( CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} "hyperion_osx" )
|
|
|
|
endif()
|
2020-02-16 16:24:33 +01:00
|
|
|
|
2016-05-24 19:56:43 +02:00
|
|
|
SET ( CPACK_ARCHIVE_COMPONENT_INSTALL ON )
|
|
|
|
SET ( CPACK_DEB_COMPONENT_INSTALL ON )
|
|
|
|
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 )
|
2020-05-12 19:51:19 +02:00
|
|
|
|
|
|
|
cpack_add_install_type(Full DISPLAY_NAME "Full")
|
|
|
|
cpack_add_install_type(Min DISPLAY_NAME "Minimal")
|
|
|
|
cpack_add_component_group(Runtime EXPANDED DESCRIPTION "Hyperion runtime and hyperion-remote commandline tool")
|
|
|
|
cpack_add_component_group(Screencapture EXPANDED DESCRIPTION "Standalone Screencapture commandline programs")
|
|
|
|
# Components base
|
|
|
|
cpack_add_component(Hyperion
|
|
|
|
DISPLAY_NAME "Hyperion"
|
|
|
|
DESCRIPTION "Hyperion runtime"
|
|
|
|
INSTALL_TYPES Full Min
|
|
|
|
GROUP Runtime
|
|
|
|
REQUIRED
|
|
|
|
)
|
|
|
|
cpack_add_component(hyperion_remote
|
|
|
|
DISPLAY_NAME "Hyperion Remote"
|
|
|
|
DESCRIPTION "Hyperion remote cli tool"
|
|
|
|
INSTALL_TYPES Full
|
|
|
|
GROUP Runtime
|
|
|
|
DEPENDS Hyperion
|
|
|
|
)
|
|
|
|
|
|
|
|
# optional compiled
|
|
|
|
if(ENABLE_QT)
|
|
|
|
cpack_add_component(hyperion_qt
|
|
|
|
DISPLAY_NAME "Qt Standalone Screencap"
|
|
|
|
DESCRIPTION "Qt based standalone screen capture"
|
|
|
|
INSTALL_TYPES Full
|
|
|
|
GROUP Screencapture
|
|
|
|
DEPENDS Hyperion
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(ENABLE_AMLOGIC)
|
|
|
|
cpack_add_component(hyperion_aml
|
|
|
|
DISPLAY_NAME "Amlogic Standalone Screencap"
|
|
|
|
DESCRIPTION "Amlogic based standalone screen capture"
|
|
|
|
INSTALL_TYPES Full
|
|
|
|
GROUP Screencapture
|
|
|
|
DEPENDS Hyperion
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(ENABLE_V4L2)
|
|
|
|
cpack_add_component(hyperion_v4l2
|
|
|
|
DISPLAY_NAME "V4l2 Standalone Screencap"
|
|
|
|
DESCRIPTION "Video for Linux 2 based standalone screen capture"
|
|
|
|
INSTALL_TYPES Full
|
|
|
|
GROUP Screencapture
|
|
|
|
DEPENDS Hyperion
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(ENABLE_X11)
|
|
|
|
cpack_add_component(hyperion_x11
|
|
|
|
DISPLAY_NAME "X11 Standalone Screencap"
|
|
|
|
DESCRIPTION "X11 based standalone screen capture"
|
|
|
|
INSTALL_TYPES Full
|
|
|
|
GROUP Screencapture
|
|
|
|
DEPENDS Hyperion
|
|
|
|
)
|
|
|
|
endif()
|
2020-08-03 12:31:39 +02:00
|
|
|
if(ENABLE_X11)
|
|
|
|
cpack_add_component(hyperion_xcb
|
|
|
|
DISPLAY_NAME "XCB Standalone Screencap"
|
|
|
|
DESCRIPTION "XCB based standalone screen capture"
|
|
|
|
INSTALL_TYPES Full
|
|
|
|
GROUP Screencapture
|
|
|
|
DEPENDS Hyperion
|
|
|
|
)
|
|
|
|
endif()
|
2020-05-12 19:51:19 +02:00
|
|
|
if(ENABLE_DISPMANX)
|
|
|
|
cpack_add_component(hyperion_dispmanx
|
|
|
|
DISPLAY_NAME "RPi dispmanx Standalone Screencap"
|
|
|
|
DESCRIPTION "Raspbery Pi dispmanx based standalone screen capture"
|
|
|
|
INSTALL_TYPES Full
|
|
|
|
GROUP Screencapture
|
|
|
|
DEPENDS Hyperion
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(ENABLE_FB)
|
|
|
|
cpack_add_component(hyperion_framebuffer
|
|
|
|
DISPLAY_NAME "Framebuffer Standalone Screencap"
|
|
|
|
DESCRIPTION "Framebuffer based standalone screen capture"
|
|
|
|
INSTALL_TYPES Full
|
|
|
|
GROUP Screencapture
|
|
|
|
DEPENDS Hyperion
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(ENABLE_OSX)
|
|
|
|
cpack_add_component(hyperion_osx
|
|
|
|
DISPLAY_NAME "Mac osx Standalone Screencap"
|
|
|
|
DESCRIPTION "Mac osx based standalone screen capture"
|
|
|
|
INSTALL_TYPES Full
|
|
|
|
GROUP Screencapture
|
|
|
|
DEPENDS Hyperion
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|