From e944ce46cdd2040b1c639ab3ef92462de8170230 Mon Sep 17 00:00:00 2001 From: redPanther Date: Sun, 22 May 2016 13:00:06 +0200 Subject: [PATCH] build optimization fix (#644) * implement make install set CMAKE_INSTALL_PREFIX e.g. to /opt to install to /opt/hyperion set ENABLE_SYSTEM_INSTALL to ON to activate installation after compiling use make install or make install/strip (for performance/size optimized binaries - compile in Release to get best performance) * cleanup cmake files use cmake -DINSTALL_PREFIX=/opt/hyperion .. to install all files to hyperion or cmake -DINSTALL_PREFIX=/usr/ to install to usr. install folders are linux standard. bin go to bin folder and additionals (effects) go to share/hyperion * add uninstall target - be patient with that, this will remove files from your system install service files to share/hyperion - if you want to use them you have to make a symlink to your location of service files * optimize build release script install service files into hyperion share folder (services not activated, this must be done by distribution package script) initial support of cmake option -DPLATFORM= option. This selects platform specific cmake flags. no need for -DENABLE_... options (unless you want some special things) automatic detect for apple build * update submodule * fix cmake error when no platform is given * initial support for deb,rpm and tgz packages - no usefull content atm! Former-commit-id: 7d7ca8685c632bb35fbe607b2ff463ef589f72e8 --- CMakeLists.txt | 11 +++++++---- cmake/packages.cmake | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 cmake/packages.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index b789b745..2bb70d16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ cmake_minimum_required(VERSION 2.8) #set(CMAKE_TOOLCHAIN_FILE /opt/raspberrypi/Toolchain-RaspberryPi.cmake) + SET ( DEFAULT_AMLOGIC OFF ) SET ( DEFAULT_DISPMANX OFF ) SET ( DEFAULT_FB OFF ) @@ -17,16 +18,16 @@ SET ( DEFAULT_WS281XPWM OFF ) if (APPLE) SET ( DEFAULT_OSX ON ) else () - if ( ${PLATFORM} STREQUAL "rpi" ) + if ( "${PLATFORM}" STREQUAL "rpi" ) SET ( DEFAULT_DISPMANX ON ) SET ( DEFAULT_WS2812BPWM ON ) SET ( DEFAULT_WS281XPWM ON ) - elseif ( ${PLATFORM} STREQUAL "wetek" ) + elseif ( "${PLATFORM}" STREQUAL "wetek" ) SET ( DEFAULT_AMLOGIC ON ) SET ( DEFAULT_FB ON ) - elseif ( ${PLATFORM} STREQUAL "x86" ) + elseif ( "${PLATFORM}" STREQUAL "x86" ) SET ( DEFAULT_X11 ON ) - elseif ( ${PLATFORM} STREQUAL "imx6" ) + elseif ( "${PLATFORM}" STREQUAL "imx6" ) SET ( DEFAULT_FB ON ) endif() endif () @@ -189,3 +190,5 @@ configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${ add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +# enable make package - no code after this line ! +include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/packages.cmake) diff --git a/cmake/packages.cmake b/cmake/packages.cmake new file mode 100644 index 00000000..17b21485 --- /dev/null +++ b/cmake/packages.cmake @@ -0,0 +1,3 @@ +SET(CPACK_GENERATOR "DEB" "RPM" "TGZ" ) +SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "hyperion team") +include (CPack)