mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Windows compilation support (#738)
* Disable AVAHI * Replace SysInfo backport with Qt SysInfo * Update vscode config * Update LedDevices * Update Logger * Update hyperiond * Update hyperion-remote * Exclude avahi * Empty definition for Process * PythonInit path broken * Exclude PiBlaster and link ws2_32 * more avahi * resolve ui bug * Update Compile howto * JsonAPI QtGrabber missing * fix error * ssize_t replacement * Nope, doesn't work * Adjust compile description and verify winSDK * Update ci script * Update ci script * Update ci * Update ci script * update Logger * Update PythonInit * added Azure & GitHub Actions, Logger, PythonInit * resolve merge conflicts * revert ssize_t in FadeCandy * look at registry for QT5 & use find_package(Python) if cmake >= 3.12 * second try * another try * and yet another test * qt5 registry search undone * Package creation test * finished package creation. only fine tuning is required :-) Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * Dependencies for Windows finished Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * use 'add_definitions()' until CMake 3.12 Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * Update .github/workflows/pull-request.yml Co-Authored-By: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com> * Update cmake/Dependencies.cmake Co-Authored-By: brindosch <edeltraud70@gmx.de> * fix typo/ add VCINSTALLDIR var * fix again * Undo change again (Not working) * fix QT grabber Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * first NSIS test Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * Update NSIS package * surprise :-) Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * Update NSIS package * fix: NSIS .bmps * Add nsis templates * Force windows gui app * fix: QSysInfo required Qt5.6, now it's 5.4 again * Update: Remove platform component and adjust package name * Add macOS as system name * Update docs * fix: Allow gh actions ci also for forks with branches * Add ReadMe docs, mention windows, add vscode linux debug config * fix: readme visual * reduce/hide banner/copyright/log message Infos here: https://docs.microsoft.com/de-de/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2019#switches * Fix PythonInit * vscode: Add runner task * fix(vscode): compiler path gcc ver independent * fix azure * vscode: add windows run tasks * move process detection * main: add windows process detection * Azure file shredder * Update docs Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com> Co-authored-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
@@ -6,7 +6,7 @@ IF (APPLE)
|
||||
ELSEIF (UNIX)
|
||||
SET ( CPACK_GENERATOR "TGZ")
|
||||
ELSEIF (WIN32)
|
||||
SET ( CPACK_GENERATOR "ZIP")
|
||||
SET ( CPACK_GENERATOR "ZIP" "NSIS")
|
||||
ENDIF()
|
||||
|
||||
# Determine packages by found generator executables
|
||||
@@ -21,32 +21,42 @@ IF(DEB_BUILDER_FOUND)
|
||||
SET ( CPACK_GENERATOR ${CPACK_GENERATOR} "DEB")
|
||||
ENDIF()
|
||||
|
||||
# Overwrite CPACK_SYSTEM_NAME for mac (visual)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
if(${CMAKE_HOST_APPLE})
|
||||
set(CMAKE_SYSTEM_NAME "macOS")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Apply to all packages, some of these can be overwritten with generator specific content
|
||||
# https://cmake.org/cmake/help/v3.5/module/CPack.html
|
||||
|
||||
SET ( CPACK_PACKAGE_NAME "Hyperion" )
|
||||
SET ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hyperion is an open source ambient light implementation" )
|
||||
SET ( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md" )
|
||||
|
||||
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()
|
||||
SET ( CPACK_PACKAGE_FILE_NAME "Hyperion-${HYPERION_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
|
||||
SET ( CPACK_PACKAGE_CONTACT "packages@hyperion-project.org")
|
||||
SET ( CPACK_PACKAGE_VENDOR "hyperion-project")
|
||||
SET ( CPACK_PACKAGE_EXECUTABLES "hyperiond;Hyperion" )
|
||||
SET ( CPACK_PACKAGE_INSTALL_DIRECTORY "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}")
|
||||
SET ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" )
|
||||
SET ( CPACK_PACKAGE_EXECUTABLES "hyperiond;Hyperion" )
|
||||
SET ( CPACK_CREATE_DESKTOP_LINKS "hyperiond;Hyperion" )
|
||||
|
||||
# Define the install prefix path for cpack
|
||||
IF ( UNIX )
|
||||
#SET ( CPACK_PACKAGING_INSTALL_PREFIX "share/hyperion")
|
||||
ENDIF()
|
||||
|
||||
# Specific CPack Package Generators
|
||||
# https://cmake.org/Wiki/CMake:CPackPackageGenerators
|
||||
# .deb files for apt
|
||||
|
||||
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" )
|
||||
SET ( CPACK_DEBIAN_PACKAGE_SECTION "Miscellaneous" )
|
||||
|
||||
@@ -55,8 +65,6 @@ SET ( CPACK_DEBIAN_PACKAGE_SECTION "Miscellaneous" )
|
||||
SET ( CPACK_RPM_PACKAGE_RELEASE 1)
|
||||
SET ( CPACK_RPM_PACKAGE_LICENSE "MIT")
|
||||
SET ( CPACK_RPM_PACKAGE_GROUP "Applications")
|
||||
|
||||
# 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" )
|
||||
SET ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/rpm/postinst" )
|
||||
SET ( CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/rpm/prerm" )
|
||||
@@ -68,29 +76,162 @@ SET ( CPACK_BUNDLE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/cmake/osxbundle/Hyperion.icn
|
||||
SET ( CPACK_BUNDLE_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/cmake/osxbundle/Info.plist )
|
||||
SET ( CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_SOURCE_DIR}/cmake/osxbundle/launch.sh" )
|
||||
|
||||
# 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")
|
||||
# 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")
|
||||
SET ( CPACK_NSIS_HELP_LINK "https://www.hyperion-project.org")
|
||||
SET ( CPACK_NSIS_URL_INFO_ABOUT "https://www.hyperion-project.org")
|
||||
# hyperiond startmenu link
|
||||
#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' ")
|
||||
|
||||
# With cli args: SET ( CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Hyperion (Debug).lnk' '$INSTDIR\\\\bin\\\\hyperiond.exe' '-d'")
|
||||
#SET ( CPACK_NSIS_EXTRA_INSTALL_COMMANDS "CreateShortCut \\\"$DESKTOP\\\\Hyperion.lnk\\\" \\\"$INSTDIR\\\\bin\\\\hyperiond.exe\\\" ")
|
||||
#SET ( CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "Delete \\\"$DESKTOP\\\\Hyperion.lnk\\\" ")
|
||||
|
||||
# define the install components
|
||||
SET ( CPACK_COMPONENTS_ALL "${PLATFORM}" )
|
||||
# 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()
|
||||
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()
|
||||
|
||||
SET ( CPACK_COMPONENT_${PLATFORM}_ARCHIVE_FILE "${CPACK_PACKAGE_FILE_NAME}" )
|
||||
SET ( CPACK_ARCHIVE_COMPONENT_INSTALL ON )
|
||||
|
||||
SET ( CPACK_DEBIAN_${PLATFORM}_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.deb" )
|
||||
SET ( CPACK_DEB_COMPONENT_INSTALL ON )
|
||||
|
||||
SET ( CPACK_RPM_${PLATFORM}_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.rpm" )
|
||||
SET ( CPACK_RPM_COMPONENT_INSTALL ON )
|
||||
|
||||
SET ( CPACK_STRIP_FILES ON )
|
||||
|
||||
# no code after following line!
|
||||
INCLUDE ( CPack )
|
||||
|
||||
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()
|
||||
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()
|
||||
|
||||
|
Reference in New Issue
Block a user