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
This commit is contained in:
redPanther 2016-05-22 13:00:06 +02:00 committed by brindosch
parent c179b86b8d
commit e944ce46cd
2 changed files with 10 additions and 4 deletions

View File

@ -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)

3
cmake/packages.cmake Normal file
View File

@ -0,0 +1,3 @@
SET(CPACK_GENERATOR "DEB" "RPM" "TGZ" )
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "hyperion team")
include (CPack)