From 9e5903e1aae273a4eddafc1998de7c27372284b5 Mon Sep 17 00:00:00 2001 From: redPanther Date: Sun, 20 Nov 2016 22:57:19 +0100 Subject: [PATCH] platform cleanup and cmake osx fix (#294) * rename platform rpi-pwm to rpi. remove original rpi platform install symlink to bin folder create effects folder for custom effects * fix osx jobs evaluation --- .travis/travis_build.sh | 49 +++++++-------- CMakeLists.txt | 84 +++++++++++++------------ bin/create_all_releases.sh | 2 +- effects/readme.txt | 11 ++++ src/hyperion-aml/CMakeLists.txt | 6 ++ src/hyperion-dispmanx/CMakeLists.txt | 6 ++ src/hyperion-framebuffer/CMakeLists.txt | 6 ++ src/hyperion-osx/CMakeLists.txt | 6 ++ src/hyperion-remote/CMakeLists.txt | 6 ++ src/hyperion-v4l2/CMakeLists.txt | 6 ++ src/hyperion-x11/CMakeLists.txt | 6 ++ src/hyperiond/CMakeLists.txt | 8 +++ src/hyperiond/main.cpp | 3 +- 13 files changed, 131 insertions(+), 68 deletions(-) create mode 100644 effects/readme.txt diff --git a/.travis/travis_build.sh b/.travis/travis_build.sh index 8129a208..f89cdabe 100755 --- a/.travis/travis_build.sh +++ b/.travis/travis_build.sh @@ -1,18 +1,20 @@ #!/bin/bash # for executing in non travis environment +[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')" -[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$(uname -s | tr 'A-Z' 'a-z')" +PLATFORM=x86 +BUILD_TYPE=Debug # Detect number of processor cores - -if [[ $TRAVIS_OS_NAME == 'osx' || $TRAVIS_OS_NAME == 'darwin' ]]; then - procs=$(sysctl -n hw.ncpu | xargs) -elif [[ $TRAVIS_OS_NAME == 'linux' ]]; then - procs=$(nproc) -else - # For most modern systems, including the pi, this is a sane default - procs=4 +# default is 4 jobs +if [[ "$TRAVIS_OS_NAME" == 'osx' || "$TRAVIS_OS_NAME" == 'darwin' ]] +then + JOBS=$(sysctl -n hw.ncpu) + PLATFORM=osx +elif [[ "$TRAVIS_OS_NAME" == 'linux' ]] +then + JOBS=$(nproc) fi # compile prepare @@ -20,24 +22,21 @@ mkdir build || exit 1 cd build # Compile hyperion for tags -if [[ -n $TRAVIS_TAG ]]; then - cmake -DPLATFORM=x86 -DCMAKE_BUILD_TYPE=Release .. || exit 2 - make -j$(nproc) || exit 3 +[ -n "${TRAVIS_TAG:-}" ] && BUILD_TYPE=Release -# Compile hyperion for cron -elif [[ $TRAVIS_EVENT_TYPE == 'cron' ]]; then - cmake -DPLATFORM=x86 -DCMAKE_BUILD_TYPE=Debug .. || exit 4 - make -j$(nproc) || exit 5 +# Compile hyperion for cron - take default settings + +# Compile for PR (no tag and no cron) +[ "${TRAVIS_EVENT_TYPE:-}" != 'cron' -a -z "${TRAVIS_TAG:-}" ] && PLATFORM=${PLATFORM}-dev + +cmake -DPLATFORM=$PLATFORM -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=/usr .. || exit 2 + +echo "compile jobs: ${JOBS:=4}" +make -j ${JOBS} || exit 3 -# Compile for PR -else - cmake -DPLATFORM=x86-dev -DCMAKE_BUILD_TYPE=Debug .. || exit 6 - make -j$(nproc) || exit 7 -fi - # Build the package on Linux - -if [[ $TRAVIS_OS_NAME == 'linux' ]]; then - make -j$(nproc) package || exit 8 +if [[ $TRAVIS_OS_NAME == 'linux' ]] +then + make -j ${JOBS} package || exit 4 fi diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c9a0de7..b518f47d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,6 @@ SET ( DEFAULT_FB ON ) SET ( DEFAULT_OSX OFF ) SET ( DEFAULT_X11 OFF ) SET ( DEFAULT_SPIDEV ON ) -SET ( DEFAULT_WS2812BPWM OFF ) SET ( DEFAULT_WS281XPWM OFF ) SET ( DEFAULT_V4L2 ON ) SET ( DEFAULT_USE_SHARED_AVAHI_LIBS OFF ) @@ -31,100 +30,102 @@ SET ( DEFAULT_USE_AVAHI_LIBS ON ) SET ( DEFAULT_USE_SYSTEM_PROTO_LIBS OFF ) SET ( DEFAULT_TESTS OFF ) +if (APPLE) + SET( PLATFORM "osx") +endif() + if ( NOT DEFINED PLATFORM ) if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86" ) SET( PLATFORM "x86") elseif ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" ) SET( PLATFORM "rpi") - EXEC_PROGRAM( "nproc" OUTPUT_VARIABLE SYSTEM_CPU_CORES ) FILE( READ /proc/cpuinfo SYSTEM_CPUINFO ) STRING ( TOLOWER "${SYSTEM_CPUINFO}" SYSTEM_CPUINFO ) if ( "${SYSTEM_CPUINFO}" MATCHES "amlogic" AND ${CMAKE_SIZEOF_VOID_P} EQUAL 4 ) SET( PLATFORM "amlogic" ) - elseif ( "${SYSTEM_CPUINFO}" MATCHES "amlogic" AND ${CMAKE_SIZEOF_VOID_P} EQUAL 8 ) + elseif ( ("${SYSTEM_CPUINFO}" MATCHES "amlogic" OR "${SYSTEM_CPUINFO}" MATCHES "ODROID-C2") AND ${CMAKE_SIZEOF_VOID_P} EQUAL 8 ) SET( PLATFORM "amlogic64" ) - elseif( SYSTEM_CPU_CORES GREATER 1 AND "${SYSTEM_CPUINFO}" MATCHES "bcm" ) - SET( PLATFORM "rpi-pwm" ) endif() endif() if ( PLATFORM ) message( STATUS "PLATFORM is not defined, evaluated platform: ${PLATFORM}") else() - message( FATAL_ERROR "PLATFORM is not defined and could not be evaluated. Set -DPLATFORM=") + message( FATAL_ERROR "PLATFORM is not defined and could not be evaluated. Set -DPLATFORM=") endif() endif() -if ( "${PLATFORM}" STREQUAL "rpi" ) +message( STATUS "PLATFORM: ${PLATFORM}") + +if ( "${PLATFORM}" MATCHES "osx" ) + SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/opt/qt5" CACHE STRING "path to your QT5 files" ) + include_directories("/opt/X11/include/") + SET ( DEFAULT_OSX ON ) + SET ( DEFAULT_V4L2 OFF ) + SET ( DEFAULT_SPIDEV OFF ) + SET ( DEFAULT_FB OFF ) + SET ( DEFAULT_WS281XPWM OFF ) + SET ( DEFAULT_USE_AVAHI_LIBS OFF ) + SET ( DEFAULT_USE_SHARED_AVAHI_LIBS OFF ) +elseif ( "${PLATFORM}" STREQUAL "rpi" ) SET ( DEFAULT_DISPMANX ON ) -elseif ( "${PLATFORM}" STREQUAL "rpi-pwm" ) - SET ( DEFAULT_DISPMANX ON ) - SET ( DEFAULT_WS2812BPWM ON ) SET ( DEFAULT_WS281XPWM ON ) -elseif ( "${PLATFORM}" STREQUAL "wetek" OR "${PLATFORM}" STREQUAL "amlogic" ) +elseif ( "${PLATFORM}" STREQUAL "amlogic" ) SET ( DEFAULT_AMLOGIC ON ) elseif ( "${PLATFORM}" STREQUAL "amlogic64" ) SET ( DEFAULT_AMLOGIC ON ) SET ( DEFAULT_USE_SYSTEM_PROTO_LIBS ON ) -elseif ( "${PLATFORM}" STREQUAL "x86" ) +elseif ( "${PLATFORM}" MATCHES "x86" ) SET ( DEFAULT_X11 ON ) SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON ) -elseif ( "${PLATFORM}" STREQUAL "x86-dev" ) - SET ( DEFAULT_X11 ON ) - SET ( DEFAULT_AMLOGIC ON) - SET ( DEFAULT_WS281XPWM ON ) - SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON ) - SET ( DEFAULT_TESTS ON ) + if ( "${PLATFORM}" STREQUAL "x86-dev" ) + SET ( DEFAULT_AMLOGIC ON) + SET ( DEFAULT_WS281XPWM ON ) + endif() elseif ( "${PLATFORM}" STREQUAL "imx6" ) SET ( DEFAULT_FB ON ) endif() -if (APPLE) - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/opt/qt5") - include_directories("/opt/X11/include/") - SET ( DEFAULT_OSX ON ) - SET ( DEFAULT_V4L2 OFF ) - SET ( DEFAULT_SPIDEV OFF ) - SET ( DEFAULT_FB OFF ) - SET ( DEFAULT_WS281XPWM OFF ) - SET ( DEFAULT_USE_AVAHI_LIBS OFF ) - SET ( DEFAULT_USE_SHARED_AVAHI_LIBS OFF ) -endif () +# enable tests for -dev builds +if ( "${PLATFORM}" MATCHES "-dev" ) + SET ( DEFAULT_TESTS ON ) +endif() + # set the build options option(ENABLE_AMLOGIC "Enable the AMLOGIC video grabber" ${DEFAULT_AMLOGIC} ) -message(STATUS "ENABLE_AMLOGIC = " ${ENABLE_AMLOGIC}) +message(STATUS "ENABLE_AMLOGIC = ${ENABLE_AMLOGIC}") option(ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ${DEFAULT_DISPMANX} ) -message(STATUS "ENABLE_DISPMANX = " ${ENABLE_DISPMANX}) +message(STATUS "ENABLE_DISPMANX = ${ENABLE_DISPMANX}") option(ENABLE_FB "Enable the framebuffer grabber" ${DEFAULT_FB} ) -message(STATUS "ENABLE_FB = " ${ENABLE_FB}) +message(STATUS "ENABLE_FB = ${ENABLE_FB}") option(ENABLE_OSX "Enable the osx grabber" ${DEFAULT_OSX} ) -message(STATUS "ENABLE_OSX = " ${ENABLE_OSX}) +message(STATUS "ENABLE_OSX = ${ENABLE_OSX}") option(ENABLE_SPIDEV "Enable the SPIDEV device" ${DEFAULT_SPIDEV} ) -message(STATUS "ENABLE_SPIDEV = " ${ENABLE_SPIDEV}) +message(STATUS "ENABLE_SPIDEV = ${ENABLE_SPIDEV}") option(ENABLE_TINKERFORGE "Enable the TINKERFORGE device" ON) -message(STATUS "ENABLE_TINKERFORGE = " ${ENABLE_TINKERFORGE}) +message(STATUS "ENABLE_TINKERFORGE = ${ENABLE_TINKERFORGE}") option(ENABLE_V4L2 "Enable the V4L2 grabber" ${DEFAULT_V4L2}) -message(STATUS "ENABLE_V4L2 = " ${ENABLE_V4L2}) +message(STATUS "ENABLE_V4L2 = ${ENABLE_V4L2}") option(ENABLE_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_WS281XPWM} ) -message(STATUS "ENABLE_WS281XPWM = " ${ENABLE_WS281XPWM}) +message(STATUS "ENABLE_WS281XPWM = ${ENABLE_WS281XPWM}") option(ENABLE_X11 "Enable the X11 grabber" ${DEFAULT_X11}) -message(STATUS "ENABLE_X11 = " ${ENABLE_X11}) +message(STATUS "ENABLE_X11 = ${ENABLE_X11}") SET(ENABLE_QT5 ON) option(ENABLE_TESTS "Compile additional test applications" ${DEFAULT_TESTS}) -message(STATUS "ENABLE_TESTS = " ${ENABLE_TESTS}) +message(STATUS "ENABLE_TESTS = ${ENABLE_TESTS}") option(ENABLE_PROFILER "enable profiler capabilities - not for release code" OFF) -message(STATUS "ENABLE_PROFILER = " ${ENABLE_PROFILER}) +message(STATUS "ENABLE_PROFILER = ${ENABLE_PROFILER}") SET ( PROTOBUF_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/proto ) @@ -171,6 +172,7 @@ else() message(STATUS "No support for C++11 detected. Compilation will most likely fail on your compiler") endif() +# add QT5 dependency SET(QT_MIN_VERSION "5.2.0") find_package(Qt5 COMPONENTS Core Gui Network REQUIRED) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") @@ -180,7 +182,7 @@ IF ( "${Qt5Core_VERSION}" VERSION_LESS "${QT_MIN_VERSION}" ) ENDIF() -#add libusb and pthreads +# Add libusb and pthreads find_package(libusb-1.0 REQUIRED) find_package(Threads REQUIRED) add_definitions(${QT_DEFINITIONS}) diff --git a/bin/create_all_releases.sh b/bin/create_all_releases.sh index 614325ae..3c8983b4 100644 --- a/bin/create_all_releases.sh +++ b/bin/create_all_releases.sh @@ -27,7 +27,7 @@ CMAKE_PROTOC_FLAG="-DIMPORT_PROTOC=../build-x86x64/protoc_export.cmake" make_release x86x64 x86 #make_release x32 x86 ${CMAKE_PROTOC_FLAG} -make_release rpi rpi-pwm -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-rpi.cmake" ${CMAKE_PROTOC_FLAG} +make_release rpi rpi -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-rpi.cmake" ${CMAKE_PROTOC_FLAG} make_release wetek wetek -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-rpi.cmake" ${CMAKE_PROTOC_FLAG} #make_release imx6 imx6 -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-imx6.cmake" ${CMAKE_PROTOC_FLAG} diff --git a/effects/readme.txt b/effects/readme.txt new file mode 100644 index 00000000..62e1bc4c --- /dev/null +++ b/effects/readme.txt @@ -0,0 +1,11 @@ +This folder is for your personal effects. +If you want to modify effect parameters only, use the effect configurator from the webinterface. +If you want to develop your own effects, place python and json files here. + +If you need examples or want to modify python file for hyperion included effect- You can export the included effects: + +hyperiond --export-effects + +e.g. + +hyperiond --export-effects /usr/share/hyperion/effects diff --git a/src/hyperion-aml/CMakeLists.txt b/src/hyperion-aml/CMakeLists.txt index 3dd46958..19751985 100644 --- a/src/hyperion-aml/CMakeLists.txt +++ b/src/hyperion-aml/CMakeLists.txt @@ -42,3 +42,9 @@ target_link_libraries(${PROJECT_NAME} qt5_use_modules(${PROJECT_NAME} Core Gui Network) install ( TARGETS ${PROJECT_NAME} DESTINATION "share/hyperion/bin/" COMPONENT "${PLATFORM}" ) + +if(CMAKE_HOST_UNIX) + install(CODE "EXECUTE_PROCESS(COMMAND ln -sf \"../share/hyperion/bin/${PROJECT_NAME}\" \"${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}\" )" COMPONENT "${PLATFORM}" ) + install(FILES "${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}" DESTINATION "bin" RENAME "${PROJECT_NAME}" COMPONENT "${PLATFORM}" ) + install(CODE "FILE (REMOVE ${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME} )" COMPONENT "${PLATFORM}" ) +endif(CMAKE_HOST_UNIX) diff --git a/src/hyperion-dispmanx/CMakeLists.txt b/src/hyperion-dispmanx/CMakeLists.txt index 4ae32152..ee669d27 100644 --- a/src/hyperion-dispmanx/CMakeLists.txt +++ b/src/hyperion-dispmanx/CMakeLists.txt @@ -44,3 +44,9 @@ target_link_libraries( ${PROJECT_NAME} qt5_use_modules(${PROJECT_NAME} Core Gui Network) install ( TARGETS ${PROJECT_NAME} DESTINATION "share/hyperion/bin/" COMPONENT "${PLATFORM}" ) + +if(CMAKE_HOST_UNIX) + install(CODE "EXECUTE_PROCESS(COMMAND ln -sf \"../share/hyperion/bin/${PROJECT_NAME}\" \"${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}\" )" COMPONENT "${PLATFORM}" ) + install(FILES "${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}" DESTINATION "bin" RENAME "${PROJECT_NAME}" COMPONENT "${PLATFORM}" ) + install(CODE "FILE (REMOVE ${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME} )" COMPONENT "${PLATFORM}" ) +endif(CMAKE_HOST_UNIX) diff --git a/src/hyperion-framebuffer/CMakeLists.txt b/src/hyperion-framebuffer/CMakeLists.txt index fca79442..191826a1 100644 --- a/src/hyperion-framebuffer/CMakeLists.txt +++ b/src/hyperion-framebuffer/CMakeLists.txt @@ -42,3 +42,9 @@ target_link_libraries( ${PROJECT_NAME} qt5_use_modules(${PROJECT_NAME} Core Gui Network) install ( TARGETS ${PROJECT_NAME} DESTINATION "share/hyperion/bin/" COMPONENT "${PLATFORM}" ) + +if(CMAKE_HOST_UNIX) + install(CODE "EXECUTE_PROCESS(COMMAND ln -sf \"../share/hyperion/bin/${PROJECT_NAME}\" \"${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}\" )" COMPONENT "${PLATFORM}" ) + install(FILES "${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}" DESTINATION "bin" RENAME "${PROJECT_NAME}" COMPONENT "${PLATFORM}" ) + install(CODE "FILE (REMOVE ${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME} )" COMPONENT "${PLATFORM}" ) +endif(CMAKE_HOST_UNIX) diff --git a/src/hyperion-osx/CMakeLists.txt b/src/hyperion-osx/CMakeLists.txt index d52e252d..a65777ba 100644 --- a/src/hyperion-osx/CMakeLists.txt +++ b/src/hyperion-osx/CMakeLists.txt @@ -42,3 +42,9 @@ target_link_libraries( ${PROJECT_NAME} qt5_use_modules(${PROJECT_NAME} Core Gui Network) install ( TARGETS ${PROJECT_NAME} DESTINATION "share/hyperion/bin/" COMPONENT "${PLATFORM}" ) + +if(CMAKE_HOST_UNIX) + install(CODE "EXECUTE_PROCESS(COMMAND ln -sf \"../share/hyperion/bin/${PROJECT_NAME}\" \"${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}\" )" COMPONENT "${PLATFORM}" ) + install(FILES "${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}" DESTINATION "bin" RENAME "${PROJECT_NAME}" COMPONENT "${PLATFORM}" ) + install(CODE "FILE (REMOVE ${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME} )" COMPONENT "${PLATFORM}" ) +endif(CMAKE_HOST_UNIX) diff --git a/src/hyperion-remote/CMakeLists.txt b/src/hyperion-remote/CMakeLists.txt index fc2aeed5..12271c0c 100644 --- a/src/hyperion-remote/CMakeLists.txt +++ b/src/hyperion-remote/CMakeLists.txt @@ -33,3 +33,9 @@ target_link_libraries(${PROJECT_NAME} qt5_use_modules(${PROJECT_NAME} Gui Core Network) install ( TARGETS ${PROJECT_NAME} DESTINATION "share/hyperion/bin/" COMPONENT "${PLATFORM}" ) + +if(CMAKE_HOST_UNIX) + install(CODE "EXECUTE_PROCESS(COMMAND ln -sf \"../share/hyperion/bin/${PROJECT_NAME}\" \"${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}\" )" COMPONENT "${PLATFORM}" ) + install(FILES "${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}" DESTINATION "bin" RENAME "${PROJECT_NAME}" COMPONENT "${PLATFORM}" ) + install(CODE "FILE (REMOVE ${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME} )" COMPONENT "${PLATFORM}" ) +endif(CMAKE_HOST_UNIX) diff --git a/src/hyperion-v4l2/CMakeLists.txt b/src/hyperion-v4l2/CMakeLists.txt index 820cf423..8fefab40 100644 --- a/src/hyperion-v4l2/CMakeLists.txt +++ b/src/hyperion-v4l2/CMakeLists.txt @@ -45,3 +45,9 @@ target_link_libraries(${PROJECT_NAME} qt5_use_modules(${PROJECT_NAME} Core Gui Network) install ( TARGETS ${PROJECT_NAME} DESTINATION "share/hyperion/bin/" COMPONENT "${PLATFORM}" ) + +if(CMAKE_HOST_UNIX) + install(CODE "EXECUTE_PROCESS(COMMAND ln -sf \"../share/hyperion/bin/${PROJECT_NAME}\" \"${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}\" )" COMPONENT "${PLATFORM}" ) + install(FILES "${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}" DESTINATION "bin" RENAME "${PROJECT_NAME}" COMPONENT "${PLATFORM}" ) + install(CODE "FILE (REMOVE ${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME} )" COMPONENT "${PLATFORM}" ) +endif(CMAKE_HOST_UNIX) diff --git a/src/hyperion-x11/CMakeLists.txt b/src/hyperion-x11/CMakeLists.txt index f8b4844b..5cfaacc2 100644 --- a/src/hyperion-x11/CMakeLists.txt +++ b/src/hyperion-x11/CMakeLists.txt @@ -45,3 +45,9 @@ target_link_libraries(${PROJECT_NAME} qt5_use_modules(${PROJECT_NAME} Core Gui Network) install ( TARGETS ${PROJECT_NAME} DESTINATION "share/hyperion/bin/" COMPONENT "${PLATFORM}" ) + +if(CMAKE_HOST_UNIX) + install(CODE "EXECUTE_PROCESS(COMMAND ln -sf \"../share/hyperion/bin/${PROJECT_NAME}\" \"${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}\" )" COMPONENT "${PLATFORM}" ) + install(FILES "${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME}" DESTINATION "bin" RENAME "${PROJECT_NAME}" COMPONENT "${PLATFORM}" ) + install(CODE "FILE (REMOVE ${CMAKE_BINARY_DIR}/symlink_${PROJECT_NAME} )" COMPONENT "${PLATFORM}" ) +endif(CMAKE_HOST_UNIX) diff --git a/src/hyperiond/CMakeLists.txt b/src/hyperiond/CMakeLists.txt index 067ca72c..3a7d456a 100644 --- a/src/hyperiond/CMakeLists.txt +++ b/src/hyperiond/CMakeLists.txt @@ -41,3 +41,11 @@ endif () install ( TARGETS hyperiond DESTINATION "share/hyperion/bin/" COMPONENT "${PLATFORM}" ) install ( DIRECTORY ${CMAKE_SOURCE_DIR}/bin/service DESTINATION "share/hyperion/" COMPONENT "${PLATFORM}" ) +install ( FILES ${CMAKE_SOURCE_DIR}/effects/readme.txt DESTINATION "share/hyperion/effects" COMPONENT "${PLATFORM}" ) + +if(CMAKE_HOST_UNIX) + install(CODE "EXECUTE_PROCESS(COMMAND ln -sf \"../share/hyperion/bin/hyperiond\" \"${CMAKE_BINARY_DIR}/symlink_hyperiond\" )" COMPONENT "${PLATFORM}" ) + install(FILES ${CMAKE_BINARY_DIR}/symlink_hyperiond DESTINATION "bin" RENAME hyperiond COMPONENT "${PLATFORM}" ) + install(CODE "FILE (REMOVE ${CMAKE_BINARY_DIR}/symlink_hyperiond )" COMPONENT "${PLATFORM}" ) +endif(CMAKE_HOST_UNIX) + diff --git a/src/hyperiond/main.cpp b/src/hyperiond/main.cpp index c53aafc0..a744b8b9 100644 --- a/src/hyperiond/main.cpp +++ b/src/hyperiond/main.cpp @@ -78,7 +78,7 @@ int main(int argc, char** argv) Option & exportConfigOption = parser.add