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

@@ -7,9 +7,9 @@ if(ENABLE_QT5)
find_package(Qt5Widgets REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
# set(CMAKE_CXX_FLAGS "-fPIC")
else(ENABLE_QT5)
else()
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
endif(ENABLE_QT5)
endif()
include_directories(
@@ -33,9 +33,9 @@ set(Hyperion_V4L2_SOURCES
)
if(ENABLE_QT5)
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})
endif(ENABLE_QT5)
endif()
add_executable(${PROJECT_NAME}
${Hyperion_V4L2_HEADERS}
@@ -56,9 +56,11 @@ target_link_libraries(${PROJECT_NAME}
if(ENABLE_QT5)
qt5_use_modules(${PROJECT_NAME} Widgets Core Gui Network)
else(ENABLE_QT5)
else()
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()