build script optimization (#642)

* 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


Former-commit-id: 5f06f314841810c780c871f810158010d3d2de70
This commit is contained in:
redPanther 2016-05-22 00:27:06 +02:00 committed by brindosch
parent 19a6bf1ee7
commit b293ea20db
13 changed files with 186 additions and 114 deletions

View File

@ -1,22 +1,47 @@
# Define the main-project name # Define the main-project name
project(Hyperion) project(hyperiond)
# define the minimum cmake version (as required by cmake) # define the minimum cmake version (as required by cmake)
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
#set(CMAKE_TOOLCHAIN_FILE /opt/raspberrypi/Toolchain-RaspberryPi.cmake) #set(CMAKE_TOOLCHAIN_FILE /opt/raspberrypi/Toolchain-RaspberryPi.cmake)
SET ( DEFAULT_AMLOGIC OFF )
SET ( DEFAULT_DISPMANX OFF )
SET ( DEFAULT_FB OFF )
SET ( DEFAULT_OSX OFF )
SET ( DEFAULT_X11 OFF )
SET ( DEFAULT_WS2812BPWM OFF )
SET ( DEFAULT_WS281XPWM OFF )
if (APPLE)
SET ( DEFAULT_OSX ON )
else ()
if ( ${PLATFORM} STREQUAL "rpi" )
SET ( DEFAULT_DISPMANX ON )
SET ( DEFAULT_WS2812BPWM ON )
SET ( DEFAULT_WS281XPWM ON )
elseif ( ${PLATFORM} STREQUAL "wetek" )
SET ( DEFAULT_AMLOGIC ON )
SET ( DEFAULT_FB ON )
elseif ( ${PLATFORM} STREQUAL "x86" )
SET ( DEFAULT_X11 ON )
elseif ( ${PLATFORM} STREQUAL "imx6" )
SET ( DEFAULT_FB ON )
endif()
endif ()
# set the build options # set the build options
option(ENABLE_AMLOGIC "Enable the AMLOGIC video grabber" OFF) 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" ON) 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" OFF) 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" OFF) option(ENABLE_OSX "Enable the osx grabber" ${DEFAULT_OSX} )
message(STATUS "ENABLE_OSX = " ${ENABLE_OSX}) message(STATUS "ENABLE_OSX = " ${ENABLE_OSX})
option(ENABLE_PROTOBUF "Enable PROTOBUF server" ON) option(ENABLE_PROTOBUF "Enable PROTOBUF server" ON)
@ -31,13 +56,13 @@ message(STATUS "ENABLE_TINKERFORGE = " ${ENABLE_TINKERFORGE})
option(ENABLE_V4L2 "Enable the V4L2 grabber" ON) option(ENABLE_V4L2 "Enable the V4L2 grabber" ON)
message(STATUS "ENABLE_V4L2 = " ${ENABLE_V4L2}) message(STATUS "ENABLE_V4L2 = " ${ENABLE_V4L2})
option(ENABLE_WS2812BPWM "Enable the WS2812b-PWM device" OFF) option(ENABLE_WS2812BPWM "Enable the WS2812b-PWM device" ${DEFAULT_WS2812BPWM} )
message(STATUS "ENABLE_WS2812BPWM = " ${ENABLE_WS2812BPWM}) message(STATUS "ENABLE_WS2812BPWM = " ${ENABLE_WS2812BPWM})
option(ENABLE_WS281XPWM "Enable the WS281x-PWM device" OFF) 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" OFF) option(ENABLE_X11 "Enable the X11 grabber" ${DEFAULT_X11})
message(STATUS "ENABLE_X11 = " ${ENABLE_X11}) message(STATUS "ENABLE_X11 = " ${ENABLE_X11})
option(ENABLE_QT5 "Enable QT5" OFF) option(ENABLE_QT5 "Enable QT5" OFF)
@ -48,20 +73,26 @@ message(STATUS "ENABLE_TESTS = " ${ENABLE_TESTS})
if(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF) if(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF)
message(FATAL_ERROR "V4L2 grabber requires PROTOBUF. Disable V4L2 or enable PROTOBUF") message(FATAL_ERROR "V4L2 grabber requires PROTOBUF. Disable V4L2 or enable PROTOBUF")
endif(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF) endif()
if(ENABLE_FB AND ENABLE_DISPMANX) if(ENABLE_FB AND ENABLE_DISPMANX)
message(FATAL_ERROR "dispmanx grabber and framebuffer grabber cannot be used at the same time") message(FATAL_ERROR "dispmanx grabber and framebuffer grabber cannot be used at the same time")
endif(ENABLE_FB AND ENABLE_DISPMANX) endif()
if(ENABLE_FB AND ENABLE_OSX) if(ENABLE_FB AND ENABLE_OSX)
message(FATAL_ERROR "osx grabber and framebuffer grabber cannot be used at the same time") message(FATAL_ERROR "osx grabber and framebuffer grabber cannot be used at the same time")
endif(ENABLE_FB AND ENABLE_OSX) endif()
if(ENABLE_OSX AND ENABLE_DISPMANX) if(ENABLE_OSX AND ENABLE_DISPMANX)
message(FATAL_ERROR "dispmanx grabber and osx grabber cannot be used at the same time") message(FATAL_ERROR "dispmanx grabber and osx grabber cannot be used at the same time")
endif(ENABLE_OSX AND ENABLE_DISPMANX) endif()
if (DEFINED INSTALL_PREFIX)
SET( ENABLE_SYSTEM_INSTALL ON)
SET( CMAKE_INSTALL_PREFIX "${INSTALL_PREFIX}" )
else()
SET(ENABLE_SYSTEM_INSTALL OFF)
endif()
SET ( PROTOBUF_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/proto ) SET ( PROTOBUF_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/proto )
SET ( PROTOBUF_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/proto ) SET ( PROTOBUF_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/proto )
@ -85,15 +116,15 @@ include_directories("${PROJECT_BINARY_DIR}")
if(ENABLE_QT5) if(ENABLE_QT5)
ADD_DEFINITIONS ( -DENABLE_QT5 ) ADD_DEFINITIONS ( -DENABLE_QT5 )
#find_package(Qt5Widgets) #find_package(Qt5Widgets)
else(ENABLE_QT5) else()
# Add specific cmake modules to find qt4 (default version finds first available QT which might not be qt4) # Add specific cmake modules to find qt4 (default version finds first available QT which might not be qt4)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/qt4) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/qt4)
endif(ENABLE_QT5) endif()
# Define the global output path of binaries # Define the global output path of binaries
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(DEPLOY_DIR "${CMAKE_SOURCE_DIR}/deploy/hyperion" )
file(MAKE_DIRECTORY ${LIBRARY_OUTPUT_PATH}) file(MAKE_DIRECTORY ${LIBRARY_OUTPUT_PATH})
file(MAKE_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) file(MAKE_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
@ -113,10 +144,10 @@ if(ENABLE_QT5)
find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED) find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
# set(CMAKE_CXX_FLAGS "-fPIC") # set(CMAKE_CXX_FLAGS "-fPIC")
else(ENABLE_QT5) else()
# Configure the use of QT4 # Configure the use of QT4
find_package(Qt4 COMPONENTS QtCore QtNetwork QtGui REQUIRED QUIET) find_package(Qt4 COMPONENTS QtCore QtNetwork QtGui REQUIRED QUIET)
endif(ENABLE_QT5) endif()
#add libusb and pthreads #add libusb and pthreads
find_package(libusb-1.0 REQUIRED) find_package(libusb-1.0 REQUIRED)
@ -124,10 +155,10 @@ find_package(Threads REQUIRED)
if(ENABLE_QT5) if(ENABLE_QT5)
#include(${QT_USE_FILE}) #include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS}) add_definitions(${QT_DEFINITIONS})
else(ENABLE_QT5) else()
include(${QT_USE_FILE}) include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS}) add_definitions(${QT_DEFINITIONS})
endif(ENABLE_QT5) endif()
# TODO[TvdZ]: This linking directory should only be added if we are cross compiling # TODO[TvdZ]: This linking directory should only be added if we are cross compiling
if(NOT APPLE) if(NOT APPLE)
@ -148,8 +179,13 @@ add_subdirectory(libsrc)
add_subdirectory(src) add_subdirectory(src)
if (ENABLE_TESTS) if (ENABLE_TESTS)
add_subdirectory(test) add_subdirectory(test)
endif (ENABLE_TESTS) endif ()
# Add the doxygen generation directory # Add the doxygen generation directory
add_subdirectory(doc) add_subdirectory(doc)
# uninstall target
configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)

View File

@ -1,43 +1,31 @@
#!/bin/sh #!/bin/sh
# create all directly for release with -DCMAKE_BUILD_TYPE=Release -Wno-dev
# Create the x64 build
mkdir build-x86x64
cd build-x86x64
cmake -DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev ..
make -j 4
cd ..
# Create the x32 build # make_release <release name> <platform> [<cmake args ...>]
#mkdir build-x32 make_release()
#cd build-x32 {
#cmake -DIMPORT_PROTOC=../build-x64/protoc_export.cmake -DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev .. echo
#make -j 4 echo "--- build release for $1 ---"
#cd .. echo
RELEASE=$1
PLATFORM=$2
shift 2
# Create the RPI build mkdir -p build-${RELEASE}
mkdir build-rpi cd build-${RELEASE}
cd build-rpi cmake -DPLATFORM=${PLATFORM} $@ -DCMAKE_BUILD_TYPE=Release -Wno-dev .. || exit 1
cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" -DIMPORT_PROTOC=../build-x86x64/protoc_export.cmake -DENABLE_WS2812BPWM=ON -DENABLE_WS281XPWM=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev .. make -j $(nproc) || exit 1
make -j 4 strip bin/*
cd .. cd ..
bin/create_release.sh . ${RELEASE}
}
# Create the WETEK build export PATH="$PATH:$HOME/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin"
mkdir build-wetek CMAKE_PROTOC_FLAG="-DIMPORT_PROTOC=../build-x86x64/protoc_export.cmake"
cd build-wetek
cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" -DIMPORT_PROTOC=../build-x86x64/protoc_export.cmake -DENABLE_DISPMANX=OFF -DENABLE_FB=ON -DENABLE_AMLOGIC=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev ..
make -j 4
cd ..
# Create the IMX6 build make_release x86x64 x86
#mkdir build-imx6 #make_release x32 x86 ${CMAKE_PROTOC_FLAG}
#cd build-imx6 make_release rpi rpi -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" ${CMAKE_PROTOC_FLAG}
#cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-imx6.cmake" -DIMPORT_PROTOC=../build-x32x64/protoc_export.cmake -DENABLE_DISPMANX=OFF -DENABLE_FB=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev .. make_release wetek rpi -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" ${CMAKE_PROTOC_FLAG}
#make -j 4 #make_release imx6 imx6 -DCMAKE_TOOLCHAIN_FILE="../Toolchain-imx6.cmake" ${CMAKE_PROTOC_FLAG}
#cd ..
bin/create_release.sh . x86x64
#bin/create_release.sh . x32
bin/create_release.sh . rpi
bin/create_release.sh . wetek
#bin/create_release.sh . imx6

View File

@ -27,11 +27,7 @@ tar --create --gzip --absolute-names --show-transformed-names --ignore-failed-re
--transform "s:$repodir/bin/service/hyperion.systemd.sh:hyperion/init.d/hyperion.systemd.sh:" \ --transform "s:$repodir/bin/service/hyperion.systemd.sh:hyperion/init.d/hyperion.systemd.sh:" \
--transform "s:$repodir/bin/service/hyperion.initctl.sh:hyperion/init.d/hyperion.initctl.sh:" \ --transform "s:$repodir/bin/service/hyperion.initctl.sh:hyperion/init.d/hyperion.initctl.sh:" \
--transform "s://:/:g" \ --transform "s://:/:g" \
"$builddir/bin/hyperiond" \ "$builddir/bin/hyperion"* \
"$builddir/bin/hyperion-remote" \
"$builddir/bin/hyperion-v4l2" \
"$builddir/bin/hyperion-x11" \
"$builddir/bin/hyperion-dispmanx" \
"$repodir/effects/"* \ "$repodir/effects/"* \
"$repodir/bin/service/hyperion.init.sh" \ "$repodir/bin/service/hyperion.init.sh" \
"$repodir/bin/service/hyperion.systemd.sh" \ "$repodir/bin/service/hyperion.systemd.sh" \

View File

@ -0,0 +1,22 @@
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)

@ -1 +1 @@
Subproject commit f82fa85f26c9ee10210469e61315d9c0182a2b81 Subproject commit 0165896aa04b08a777fb6732a1af6fa29e4a93c5

View File

@ -31,9 +31,9 @@ set(Hyperion_AML_SOURCES
if(ENABLE_QT5) if(ENABLE_QT5)
QT5_WRAP_CPP(Hyperion_AML_HEADERS_MOC ${Hyperion_AML_QT_HEADERS}) QT5_WRAP_CPP(Hyperion_AML_HEADERS_MOC ${Hyperion_AML_QT_HEADERS})
else(ENABLE_QT5) else()
QT4_WRAP_CPP(Hyperion_AML_HEADERS_MOC ${Hyperion_AML_QT_HEADERS}) QT4_WRAP_CPP(Hyperion_AML_HEADERS_MOC ${Hyperion_AML_QT_HEADERS})
endif(ENABLE_QT5) endif()
add_executable(${PROJECT_NAME} add_executable(${PROJECT_NAME}
${Hyperion_AML_HEADERS} ${Hyperion_AML_HEADERS}
@ -57,8 +57,11 @@ qt4_use_modules(${PROJECT_NAME}
if(ENABLE_QT5) if(ENABLE_QT5)
qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network) qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network)
else(ENABLE_QT5) else()
qt4_use_modules(${PROJECT_NAME} Core Gui Network ) qt4_use_modules(${PROJECT_NAME} Core Gui Network )
endif(ENABLE_QT5) endif()
install ( TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_SOURCE_DIR}/deploy/bin" ) install ( TARGETS ${PROJECT_NAME} DESTINATION "${DEPLOY_DIR}/bin" )
if (ENABLE_SYSTEM_INSTALL)
install ( TARGETS ${PROJECT_NAME} DESTINATION "bin" )
endif()

View File

@ -7,9 +7,9 @@ project(hyperion-dispmanx)
# find QT # find QT
if(ENABLE_QT5) if(ENABLE_QT5)
find_package(Qt5Widgets REQUIRED) find_package(Qt5Widgets REQUIRED)
else(ENABLE_QT5) else()
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork ) find_package(Qt4 REQUIRED QtCore QtGui QtNetwork )
endif(ENABLE_QT5) endif()
# Find the BCM-package (VC control) # Find the BCM-package (VC control)
find_package(BCM REQUIRED) find_package(BCM REQUIRED)
@ -34,9 +34,9 @@ set(Hyperion_Dispmanx_SOURCES
if(ENABLE_QT5) if(ENABLE_QT5)
QT5_WRAP_CPP(Hyperion_Dispmanx_HEADERS_MOC ${Hyperion_Dispmanx_QT_HEADERS}) QT5_WRAP_CPP(Hyperion_Dispmanx_HEADERS_MOC ${Hyperion_Dispmanx_QT_HEADERS})
else(ENABLE_QT5) else()
QT4_WRAP_CPP(Hyperion_Dispmanx_HEADERS_MOC ${Hyperion_Dispmanx_QT_HEADERS}) QT4_WRAP_CPP(Hyperion_Dispmanx_HEADERS_MOC ${Hyperion_Dispmanx_QT_HEADERS})
endif(ENABLE_QT5) endif()
add_executable( ${PROJECT_NAME} add_executable( ${PROJECT_NAME}
${Hyperion_Dispmanx_HEADERS} ${Hyperion_Dispmanx_HEADERS}
@ -56,9 +56,12 @@ target_link_libraries( ${PROJECT_NAME}
if(ENABLE_QT5) if(ENABLE_QT5)
qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network) qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network)
else(ENABLE_QT5) else()
qt4_use_modules(${PROJECT_NAME} Core Gui Network ) qt4_use_modules(${PROJECT_NAME} Core Gui Network )
endif(ENABLE_QT5) endif()
install ( TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_SOURCE_DIR}/deploy/bin" ) install ( TARGETS ${PROJECT_NAME} DESTINATION "${DEPLOY_DIR}/bin" )
if (ENABLE_SYSTEM_INSTALL)
install ( TARGETS ${PROJECT_NAME} DESTINATION "bin" )
endif()

View File

@ -7,9 +7,9 @@ project(hyperion-framebuffer)
# find QT # find QT
if(ENABLE_QT5) if(ENABLE_QT5)
find_package(Qt5Widgets REQUIRED) find_package(Qt5Widgets REQUIRED)
else(ENABLE_QT5) else()
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork ) find_package(Qt4 REQUIRED QtCore QtGui QtNetwork )
endif(ENABLE_QT5) endif()
include_directories( include_directories(
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/protoserver ${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/protoserver
@ -31,9 +31,9 @@ set(Hyperion_FB_SOURCES
if(ENABLE_QT5) if(ENABLE_QT5)
QT5_WRAP_CPP(Hyperion_FB_HEADERS_MOC ${Hyperion_FB_QT_HEADERS}) QT5_WRAP_CPP(Hyperion_FB_HEADERS_MOC ${Hyperion_FB_QT_HEADERS})
else(ENABLE_QT5) else()
QT4_WRAP_CPP(Hyperion_FB_HEADERS_MOC ${Hyperion_FB_QT_HEADERS}) QT4_WRAP_CPP(Hyperion_FB_HEADERS_MOC ${Hyperion_FB_QT_HEADERS})
endif(ENABLE_QT5) endif()
add_executable( ${PROJECT_NAME} add_executable( ${PROJECT_NAME}
${Hyperion_FB_HEADERS} ${Hyperion_FB_HEADERS}
@ -52,6 +52,11 @@ target_link_libraries( ${PROJECT_NAME}
if(ENABLE_QT5) if(ENABLE_QT5)
qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network) qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network)
else(ENABLE_QT5) else()
qt4_use_modules(${PROJECT_NAME} Core Gui Network ) qt4_use_modules(${PROJECT_NAME} Core Gui Network )
endif(ENABLE_QT5) endif()
install ( TARGETS ${PROJECT_NAME} DESTINATION "${DEPLOY_DIR}/bin" )
if (ENABLE_SYSTEM_INSTALL)
install ( TARGETS ${PROJECT_NAME} DESTINATION "bin" )
endif()

View File

@ -7,9 +7,9 @@ project(hyperion-osx)
# find QT # find QT
if(ENABLE_QT5) if(ENABLE_QT5)
find_package(Qt5Widgets REQUIRED) find_package(Qt5Widgets REQUIRED)
else(ENABLE_QT5) else()
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork ) find_package(Qt4 REQUIRED QtCore QtGui QtNetwork )
endif(ENABLE_QT5) endif()
include_directories( include_directories(
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/protoserver ${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/protoserver
@ -31,9 +31,9 @@ set(Hyperion_OSX_SOURCES
if(ENABLE_QT5) if(ENABLE_QT5)
QT5_WRAP_CPP(Hyperion_OSX_HEADERS_MOC ${Hyperion_OSX_QT_HEADERS}) QT5_WRAP_CPP(Hyperion_OSX_HEADERS_MOC ${Hyperion_OSX_QT_HEADERS})
else(ENABLE_QT5) else()
QT4_WRAP_CPP(Hyperion_OSX_HEADERS_MOC ${Hyperion_OSX_QT_HEADERS}) QT4_WRAP_CPP(Hyperion_OSX_HEADERS_MOC ${Hyperion_OSX_QT_HEADERS})
endif(ENABLE_QT5) endif()
add_executable( ${PROJECT_NAME} add_executable( ${PROJECT_NAME}
${Hyperion_OSX_HEADERS} ${Hyperion_OSX_HEADERS}
@ -52,6 +52,9 @@ target_link_libraries( ${PROJECT_NAME}
if(ENABLE_QT5) if(ENABLE_QT5)
qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network) qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network)
else(ENABLE_QT5) else()
qt4_use_modules(${PROJECT_NAME} Core Gui Network ) qt4_use_modules(${PROJECT_NAME} Core Gui Network )
endif(ENABLE_QT5) endif()
install ( TARGETS ${PROJECT_NAME} DESTINATION "${DEPLOY_DIR}/bin" )

View File

@ -7,9 +7,9 @@ if(ENABLE_QT5)
find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED) find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
# set(CMAKE_CXX_FLAGS "-fPIC") # set(CMAKE_CXX_FLAGS "-fPIC")
else(ENABLE_QT5) else()
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork) find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
endif(ENABLE_QT5) endif()
# The following I do not undrstand completely... # The following I do not undrstand completely...
# libQtCore.so uses some hardcoded library path inside which are incorrect after copying the file RPi file system # libQtCore.so uses some hardcoded library path inside which are incorrect after copying the file RPi file system
@ -38,9 +38,12 @@ target_link_libraries(${PROJECT_NAME}
if(ENABLE_QT5) if(ENABLE_QT5)
qt5_use_modules(${PROJECT_NAME} Widgets Core Network) qt5_use_modules(${PROJECT_NAME} Widgets Core Network)
else(ENABLE_QT5) else()
qt4_use_modules(${PROJECT_NAME} Core Gui Network ) qt4_use_modules(${PROJECT_NAME} Core Gui Network )
endif(ENABLE_QT5) endif()
install ( TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_SOURCE_DIR}/deploy/bin" ) install ( TARGETS ${PROJECT_NAME} DESTINATION "${DEPLOY_DIR}/bin" )
if (ENABLE_SYSTEM_INSTALL)
install ( TARGETS ${PROJECT_NAME} DESTINATION "bin" )
endif()

View File

@ -7,9 +7,9 @@ if(ENABLE_QT5)
find_package(Qt5Widgets REQUIRED) find_package(Qt5Widgets REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
# set(CMAKE_CXX_FLAGS "-fPIC") # set(CMAKE_CXX_FLAGS "-fPIC")
else(ENABLE_QT5) else()
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork) find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
endif(ENABLE_QT5) endif()
include_directories( include_directories(
@ -33,9 +33,9 @@ set(Hyperion_V4L2_SOURCES
) )
if(ENABLE_QT5) if(ENABLE_QT5)
QT5_WRAP_CPP(Hyperion_V4L2_MOC_SOURCES ${Hyperion_V4L2_QT_HEADERS}) QT5_WRAP_CPP(Hyperion_V4L2_MOC_SOURCES ${Hyperion_V4L2_QT_HEADERS})
else(ENABLE_QT5) else()
QT4_WRAP_CPP(Hyperion_V4L2_MOC_SOURCES ${Hyperion_V4L2_QT_HEADERS}) QT4_WRAP_CPP(Hyperion_V4L2_MOC_SOURCES ${Hyperion_V4L2_QT_HEADERS})
endif(ENABLE_QT5) endif()
add_executable(${PROJECT_NAME} add_executable(${PROJECT_NAME}
${Hyperion_V4L2_HEADERS} ${Hyperion_V4L2_HEADERS}
@ -56,9 +56,11 @@ target_link_libraries(${PROJECT_NAME}
if(ENABLE_QT5) if(ENABLE_QT5)
qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network) qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network)
else(ENABLE_QT5) else()
qt4_use_modules(${PROJECT_NAME} Core Gui Network ) qt4_use_modules(${PROJECT_NAME} Core Gui Network )
endif(ENABLE_QT5) endif()
install ( TARGETS ${PROJECT_NAME} DESTINATION "${DEPLOY_DIR}/bin" )
install ( TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_SOURCE_DIR}/deploy/bin" ) if (ENABLE_SYSTEM_INSTALL)
install ( TARGETS ${PROJECT_NAME} DESTINATION "bin" )
endif()

View File

@ -7,9 +7,9 @@ project(hyperion-x11)
# find QT # find QT
if(ENABLE_QT5) if(ENABLE_QT5)
find_package(Qt5Widgets REQUIRED) find_package(Qt5Widgets REQUIRED)
else(ENABLE_QT5) else()
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork) find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
endif(ENABLE_QT5) endif()
# Find X11 # Find X11
find_package(X11 REQUIRED) find_package(X11 REQUIRED)
@ -34,9 +34,9 @@ set(Hyperion_X11_SOURCES
if(ENABLE_QT5) if(ENABLE_QT5)
QT5_WRAP_CPP(Hyperion_X11_HEADERS_MOC ${Hyperion_X11_QT_HEADERS}) QT5_WRAP_CPP(Hyperion_X11_HEADERS_MOC ${Hyperion_X11_QT_HEADERS})
else(ENABLE_QT5) else()
QT4_WRAP_CPP(Hyperion_X11_HEADERS_MOC ${Hyperion_X11_QT_HEADERS}) QT4_WRAP_CPP(Hyperion_X11_HEADERS_MOC ${Hyperion_X11_QT_HEADERS})
endif(ENABLE_QT5) endif()
add_executable(${PROJECT_NAME} add_executable(${PROJECT_NAME}
@ -57,8 +57,11 @@ target_link_libraries(${PROJECT_NAME}
if(ENABLE_QT5) if(ENABLE_QT5)
qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network) qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network)
else(ENABLE_QT5) else()
qt4_use_modules(${PROJECT_NAME} Core Gui Network ) qt4_use_modules(${PROJECT_NAME} Core Gui Network )
endif(ENABLE_QT5) endif()
install ( TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_SOURCE_DIR}/deploy/bin" ) install ( TARGETS ${PROJECT_NAME} DESTINATION "${DEPLOY_DIR}/bin" )
if (ENABLE_SYSTEM_INSTALL)
install ( TARGETS ${PROJECT_NAME} DESTINATION "bin" )
endif()

View File

@ -12,26 +12,34 @@ target_link_libraries(hyperiond
if (ENABLE_DISPMANX) if (ENABLE_DISPMANX)
target_link_libraries(hyperiond dispmanx-grabber) target_link_libraries(hyperiond dispmanx-grabber)
endif (ENABLE_DISPMANX) endif ()
if (ENABLE_FB) if (ENABLE_FB)
target_link_libraries(hyperiond framebuffer-grabber) target_link_libraries(hyperiond framebuffer-grabber)
endif (ENABLE_FB) endif ()
if (ENABLE_OSX) if (ENABLE_OSX)
target_link_libraries(hyperiond osx-grabber) target_link_libraries(hyperiond osx-grabber)
endif (ENABLE_OSX) endif ()
if (ENABLE_V4L2) if (ENABLE_V4L2)
target_link_libraries(hyperiond v4l2-grabber) target_link_libraries(hyperiond v4l2-grabber)
endif (ENABLE_V4L2) endif ()
if (ENABLE_AMLOGIC) if (ENABLE_AMLOGIC)
target_link_libraries(hyperiond amlogic-grabber) target_link_libraries(hyperiond amlogic-grabber)
endif (ENABLE_AMLOGIC) endif ()
if (ENABLE_PROTOBUF) if (ENABLE_PROTOBUF)
target_link_libraries(hyperiond protoserver) target_link_libraries(hyperiond protoserver)
endif (ENABLE_PROTOBUF) endif ()
install ( TARGETS hyperiond DESTINATION "${CMAKE_SOURCE_DIR}/deploy/bin" ) install ( TARGETS hyperiond DESTINATION "${DEPLOY_DIR}/bin" )
install ( DIRECTORY ${CMAKE_SOURCE_DIR}/effects DESTINATION "${DEPLOY_DIR}/share/hyperion/" )
install ( DIRECTORY ${CMAKE_SOURCE_DIR}/bin/service DESTINATION "${DEPLOY_DIR}/share/hyperion/" )
if (ENABLE_SYSTEM_INSTALL)
install ( TARGETS hyperiond DESTINATION "bin" )
install ( DIRECTORY ${CMAKE_SOURCE_DIR}/effects DESTINATION "share/hyperion/" )
install ( DIRECTORY ${CMAKE_SOURCE_DIR}/bin/service DESTINATION "share/hyperion/" )
endif()