From e01bcd708dd220c2b0d08398c59b8c51f74f2959 Mon Sep 17 00:00:00 2001 From: redpanther Date: Thu, 10 Mar 2016 12:22:44 +0100 Subject: [PATCH] add install commands instead of "make" use "make install/strip" release compile Former-commit-id: f4dd2d9e1a4d815b667665892a3bd9cec64218a3 --- CMakeLists.txt | 3 + src/hyperion-aml/CMakeLists.txt | 9 ++- src/hyperion-dispmanx/CMakeLists.txt | 3 + src/hyperion-remote/CMakeLists.txt | 84 ++++++++++++++-------------- src/hyperion-v4l2/CMakeLists.txt | 3 + src/hyperion-x11/CMakeLists.txt | 2 + src/hyperiond/CMakeLists.txt | 2 + 7 files changed, 62 insertions(+), 44 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04f54483..d8237edd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,9 @@ if(ENABLE_OSX AND ENABLE_DISPMANX) endif(ENABLE_OSX AND ENABLE_DISPMANX) +SET ( PROTOBUF_INSTALL_BIN_DIR ${CMAKE_SOURCE_DIR}/deploy ) +SET ( PROTOBUF_INSTALL_LIB_DIR ${CMAKE_SOURCE_DIR}/deploy ) + #if(ENABLE_QT5) # TODO vs ENABLE_QT4? #endif(ENABLE_QT5) diff --git a/src/hyperion-aml/CMakeLists.txt b/src/hyperion-aml/CMakeLists.txt index cd27c046..e7e7bdff 100644 --- a/src/hyperion-aml/CMakeLists.txt +++ b/src/hyperion-aml/CMakeLists.txt @@ -31,13 +31,13 @@ else(ENABLE_QT5) QT4_WRAP_CPP(Hyperion_AML_HEADERS_MOC ${Hyperion_AML_QT_HEADERS}) endif(ENABLE_QT5) -add_executable(hyperion-amlogic +add_executable(${PROJECT_NAME} ${Hyperion_AML_HEADERS} ${Hyperion_AML_SOURCES} ${Hyperion_AML_HEADERS_MOC} ) -target_link_libraries(hyperion-amlogic +target_link_libraries(${PROJECT_NAME} getoptPlusPlus blackborder hyperion-utils @@ -46,7 +46,10 @@ target_link_libraries(hyperion-amlogic pthread ) -qt4_use_modules(hyperion-amlogic +qt4_use_modules(${PROJECT_NAME} Core Gui Network) + +install ( TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_SOURCE_DIR}/deploy/bin" ) + diff --git a/src/hyperion-dispmanx/CMakeLists.txt b/src/hyperion-dispmanx/CMakeLists.txt index 130cb661..3263589f 100644 --- a/src/hyperion-dispmanx/CMakeLists.txt +++ b/src/hyperion-dispmanx/CMakeLists.txt @@ -63,3 +63,6 @@ else(ENABLE_QT5) Network ) endif(ENABLE_QT5) + + +install ( TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_SOURCE_DIR}/deploy/bin" ) diff --git a/src/hyperion-remote/CMakeLists.txt b/src/hyperion-remote/CMakeLists.txt index b8c73a59..c2bfdcff 100644 --- a/src/hyperion-remote/CMakeLists.txt +++ b/src/hyperion-remote/CMakeLists.txt @@ -1,41 +1,43 @@ -cmake_minimum_required(VERSION 2.8) - -project(hyperion-remote) - -# find Qt4 -if(ENABLE_QT5) -find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED) -# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") -# set(CMAKE_CXX_FLAGS "-fPIC") -else(ENABLE_QT5) -find_package(Qt4 REQUIRED QtCore QtGui QtNetwork) -endif(ENABLE_QT5) - -# 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 -# Therefor, an extra path is needed on which to find the required libraries -LINK_DIRECTORIES(${LINK_DIRECTORIES} ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf) - -include_directories(${QT_INCLUDES}) - -set(hyperion-remote_HEADERS - CustomParameter.h - JsonConnection.h - ColorTransformValues.h) - -set(hyperion-remote_SOURCES - hyperion-remote.cpp - JsonConnection.cpp) - -add_executable(hyperion-remote - ${hyperion-remote_HEADERS} - ${hyperion-remote_SOURCES}) - -if(ENABLE_QT5) -qt5_use_modules(hyperion-remote Widgets Network) -endif(ENABLE_QT5) - -target_link_libraries(hyperion-remote - jsoncpp - getoptPlusPlus - ${QT_LIBRARIES}) +cmake_minimum_required(VERSION 2.8) + +project(hyperion-remote) + +# find Qt4 +if(ENABLE_QT5) +find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED) +# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") +# set(CMAKE_CXX_FLAGS "-fPIC") +else(ENABLE_QT5) +find_package(Qt4 REQUIRED QtCore QtGui QtNetwork) +endif(ENABLE_QT5) + +# 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 +# Therefor, an extra path is needed on which to find the required libraries +LINK_DIRECTORIES(${LINK_DIRECTORIES} ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf) + +include_directories(${QT_INCLUDES}) + +set(hyperion-remote_HEADERS + CustomParameter.h + JsonConnection.h + ColorTransformValues.h) + +set(hyperion-remote_SOURCES + hyperion-remote.cpp + JsonConnection.cpp) + +add_executable(hyperion-remote + ${hyperion-remote_HEADERS} + ${hyperion-remote_SOURCES}) + +if(ENABLE_QT5) +qt5_use_modules(hyperion-remote Widgets Network) +endif(ENABLE_QT5) + +target_link_libraries(hyperion-remote + jsoncpp + getoptPlusPlus + ${QT_LIBRARIES}) + +install ( TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_SOURCE_DIR}/deploy/bin" ) diff --git a/src/hyperion-v4l2/CMakeLists.txt b/src/hyperion-v4l2/CMakeLists.txt index ef051e2d..173e7fd2 100644 --- a/src/hyperion-v4l2/CMakeLists.txt +++ b/src/hyperion-v4l2/CMakeLists.txt @@ -53,3 +53,6 @@ target_link_libraries(hyperion-v4l2 pthread ${QT_LIBRARIES} ) + +install ( TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_SOURCE_DIR}/deploy/bin" ) + diff --git a/src/hyperion-x11/CMakeLists.txt b/src/hyperion-x11/CMakeLists.txt index 626781f9..a6f9c513 100644 --- a/src/hyperion-x11/CMakeLists.txt +++ b/src/hyperion-x11/CMakeLists.txt @@ -62,3 +62,5 @@ qt4_use_modules(hyperion-x11 Gui Network) endif(ENABLE_QT5) + +install ( TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_SOURCE_DIR}/deploy/bin" ) diff --git a/src/hyperiond/CMakeLists.txt b/src/hyperiond/CMakeLists.txt index 70c2381b..5aef74d2 100644 --- a/src/hyperiond/CMakeLists.txt +++ b/src/hyperiond/CMakeLists.txt @@ -33,3 +33,5 @@ endif (ENABLE_AMLOGIC) if (ENABLE_PROTOBUF) target_link_libraries(hyperiond protoserver) endif (ENABLE_PROTOBUF) + +install ( TARGETS hyperiond DESTINATION "${CMAKE_SOURCE_DIR}/deploy/bin" )