From 5cd38810678a67e8d5c15de9bfc043bafe135e00 Mon Sep 17 00:00:00 2001 From: LordGrey <48840279+Lord-Grey@users.noreply.github.com> Date: Sat, 5 Mar 2022 15:18:01 +0100 Subject: [PATCH] Hyperion Light updates (#1434) * Hyperion Light - Allow hyperion remote as component * Fix missing guard * NSIS installation via Choco removed because already installed on windows server 2022 * Correct CMAKEList defaults * Align package creation with build rules for components * Fix Copy/Paste issue Co-authored-by: Paulchen Panther --- .github/workflows/pull-request.yml | 4 +- .github/workflows/push-master.yml | 4 +- CMakeLists.txt | 26 ++-- HyperionConfig.h.in | 3 + cmake/packages.cmake | 215 +++++++++++++++-------------- dependencies/CMakeLists.txt | 4 +- src/CMakeLists.txt | 5 +- 7 files changed, 143 insertions(+), 118 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 5e94c292..fcb0b0aa 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -159,10 +159,10 @@ jobs: path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey key: ${{ runner.os }}-chocolatey - - name: Install Python, NSIS, OpenSSL, DirectX SDK + - name: Install Python, OpenSSL, DirectX SDK shell: powershell run: | - choco install --no-progress python nsis openssl directx-sdk -y + choco install --no-progress python openssl directx-sdk -y - name: Install libjpeg-turbo run: | diff --git a/.github/workflows/push-master.yml b/.github/workflows/push-master.yml index e332bf9d..98882bf1 100644 --- a/.github/workflows/push-master.yml +++ b/.github/workflows/push-master.yml @@ -122,10 +122,10 @@ jobs: path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey key: ${{ runner.os }}-chocolatey - - name: Install Python, NSIS, OpenSSL, DirectX SDK + - name: Install Python, OpenSSL, DirectX SDK shell: powershell run: | - choco install --no-progress python nsis openssl directx-sdk -y + choco install --no-progress python openssl directx-sdk -y - name: Install libjpeg-turbo run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 51cf35ac..7dfe6e71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,7 @@ SET ( DEFAULT_DEV_WS281XPWM OFF ) SET ( DEFAULT_AVAHI ON ) SET ( DEFAULT_EFFECTENGINE ON ) SET ( DEFAULT_EXPERIMENTAL OFF ) +SET ( DEFAULT_REMOTE_CTL ON ) # Build SET ( DEFAULT_JSONCHECKS ON ) @@ -296,10 +297,10 @@ message(STATUS "LED-Device options:") addIndent(" - ") option(ENABLE_DEV_NETWORK "Enable the Network devices" ${DEFAULT_DEV_NETWORK} ) -message(STATUS "DEFAULT_DEV_NETWORK = ${DEFAULT_DEV_NETWORK}") +message(STATUS "ENABLE_DEV_NETWORK = ${ENABLE_DEV_NETWORK}") option(ENABLE_DEV_SERIAL "Enable the Serial devices" ${DEFAULT_DEV_SERIAL} ) -message(STATUS "DEFAULT_DEV_SERIAL = ${DEFAULT_DEV_SERIAL}") +message(STATUS "ENABLE_DEV_SERIAL = ${ENABLE_DEV_SERIAL}") option(ENABLE_DEV_SPI "Enable the SPI device" ${DEFAULT_DEV_SPI} ) message(STATUS "ENABLE_DEV_SPI = ${ENABLE_DEV_SPI}") @@ -318,15 +319,18 @@ removeIndent() message(STATUS "Services options:") addIndent(" - ") -option(ENABLE_EFFECTENGINE "Enable Effect-Engine" ${DEFAULT_EFFECTENGINE}) -message(STATUS "ENABLE_EFFECTENGINE = " ${ENABLE_EFFECTENGINE}) - option(ENABLE_AVAHI "Enable Zeroconf" ${DEFAULT_AVAHI}) message(STATUS "ENABLE_AVAHI = " ${ENABLE_AVAHI}) +option(ENABLE_EFFECTENGINE "Enable Effect-Engine" ${DEFAULT_EFFECTENGINE}) +message(STATUS "ENABLE_EFFECTENGINE = " ${ENABLE_EFFECTENGINE}) + option(ENABLE_EXPERIMENTAL "Compile experimental features" ${DEFAULT_EXPERIMENTAL}) message(STATUS "ENABLE_EXPERIMENTAL = ${ENABLE_EXPERIMENTAL}") +option(ENABLE_REMOTE_CTL "Enable Hyperion remote control" ${DEFAULT_REMOTE_CTL}) +message(STATUS "ENABLE_REMOTE_CTL = " ${ENABLE_REMOTE_CTL}) + removeIndent() message(STATUS "Build options:") @@ -338,6 +342,12 @@ message(STATUS "ENABLE_JSONCHECKS = ${ENABLE_JSONCHECKS}") option(ENABLE_DEPLOY_DEPENDENCIES "Deploy with dependencies" ${DEFAULT_DEPLOY_DEPENDENCIES}) message(STATUS "ENABLE_DEPLOY_DEPENDENCIES = ${ENABLE_DEPLOY_DEPENDENCIES}") +option(ENABLE_PROFILER "enable profiler capabilities - not for release code" OFF) +message(STATUS "ENABLE_PROFILER = ${ENABLE_PROFILER}") + +option(ENABLE_TESTS "Compile additional test applications" ${DEFAULT_TESTS}) +message(STATUS "ENABLE_TESTS = ${ENABLE_TESTS}") + if (ENABLE_AVAHI) message(STATUS "DEFAULT_USE_SHARED_AVAHI_LIBS = ${DEFAULT_USE_SHARED_AVAHI_LIBS}") endif() @@ -345,12 +355,6 @@ message(STATUS "DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS = ${DEFAULT_USE_SYSTEM_FLATB message(STATUS "DEFAULT_USE_SYSTEM_MBEDTLS_LIBS = ${DEFAULT_USE_SYSTEM_MBEDTLS_LIBS}") message(STATUS "DEFAULT_USE_SYSTEM_PROTO_LIBS = ${DEFAULT_USE_SYSTEM_PROTO_LIBS}") -option(ENABLE_PROFILER "enable profiler capabilities - not for release code" OFF) -message(STATUS "ENABLE_PROFILER = ${ENABLE_PROFILER}") - -option(ENABLE_TESTS "Compile additional test applications" ${DEFAULT_TESTS}) -message(STATUS "ENABLE_TESTS = ${ENABLE_TESTS}") - removeIndent() SET ( FLATBUFFERS_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/flatbuf ) diff --git a/HyperionConfig.h.in b/HyperionConfig.h.in index 272da230..87db4cd3 100644 --- a/HyperionConfig.h.in +++ b/HyperionConfig.h.in @@ -78,6 +78,9 @@ // Define to enable experimental features #cmakedefine ENABLE_EXPERIMENTAL +// Define to enable Hyperion remote control +#cmakedefine ENABLE_REMOTE_CTL + // Define to enable profiler for development purpose #cmakedefine ENABLE_PROFILER diff --git a/cmake/packages.cmake b/cmake/packages.cmake index 346d21bf..bc73057d 100644 --- a/cmake/packages.cmake +++ b/cmake/packages.cmake @@ -138,34 +138,40 @@ SET ( CPACK_COMPONENTS_GROUPING "ALL_COMPONENTS_IN_ONE") # Components base (All builds) SET ( CPACK_COMPONENTS_ALL "Hyperion" ) -SET ( CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} "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_XCB) - SET ( CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} "hyperion_xcb" ) -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" ) + +if(ENABLE_REMOTE_CTL) + SET ( CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} "hyperion_remote" ) endif() +# only include standalone grabber with build was with flatbuffer client +if(ENABLE_FLATBUF_CONNECT) + 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_XCB) + SET ( CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} "hyperion_xcb" ) + 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() +endif(ENABLE_FLATBUF_CONNECT) + # Only include Hyperion to macOS dmg package (without standalone programs) IF ( CPACK_GENERATOR MATCHES "DragNDrop" ) LIST ( REMOVE_ITEM CPACK_COMPONENTS_ALL "hyperion_remote" "hyperion_qt" "hyperion_osx" ) @@ -182,8 +188,7 @@ 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") +cpack_add_component_group(Runtime EXPANDED DESCRIPTION "Hyperion runtime") # Components base cpack_add_component(Hyperion @@ -194,84 +199,92 @@ cpack_add_component(Hyperion REQUIRED ) +# optional components + +if(ENABLE_REMOTE_CTL) +cpack_add_component_group(Remote DESCRIPTION "hyperion-remote commandline tool") cpack_add_component(hyperion_remote DISPLAY_NAME "Hyperion Remote" DESCRIPTION "Hyperion remote cli tool" INSTALL_TYPES Full - GROUP Runtime + GROUP Remote DEPENDS Hyperion ) +endif() -# 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_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() -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() +# only include standalone grabber with build was with flatbuffer client +if(ENABLE_FLATBUF_CONNECT) + cpack_add_component_group(Screencapture EXPANDED DESCRIPTION "Standalone Screencapture commandline programs") + 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_XCB) + cpack_add_component(hyperion_xcb + DISPLAY_NAME "XCB Standalone Screencap" + DESCRIPTION "XCB 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() +endif(ENABLE_FLATBUF_CONNECT) diff --git a/dependencies/CMakeLists.txt b/dependencies/CMakeLists.txt index 3566eaba..9be0d48f 100644 --- a/dependencies/CMakeLists.txt +++ b/dependencies/CMakeLists.txt @@ -1,4 +1,6 @@ -add_subdirectory(build/hidapi) +if (ENABLE_DEV_USB_HID) + add_subdirectory(build/hidapi) +endif() if (ENABLE_DEV_TINKERFORGE) add_subdirectory(build/tinkerforge) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index abd34199..8525c3f0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,10 @@ add_subdirectory(hyperiond) -add_subdirectory(hyperion-remote) # The following binaries are just compiled if requested +if (ENABLE_REMOTE_CTL) + add_subdirectory(hyperion-remote) +endif() + if (ENABLE_AMLOGIC AND ENABLE_FLATBUF_CONNECT) add_subdirectory(hyperion-aml) endif()