From 992dd6ea847f041e208004607fdf7f5068fa63e2 Mon Sep 17 00:00:00 2001 From: brindosch Date: Fri, 13 Oct 2017 00:06:31 +0200 Subject: [PATCH] cmake 3.0.0 (#480) --- CMakeLists.txt | 4 +++- CompileHowto.md | 7 +++++++ libsrc/effectengine/CMakeLists.txt | 4 +--- libsrc/hyperion/CMakeLists.txt | 4 ++-- libsrc/leddevice/CMakeLists.txt | 8 ++------ libsrc/utils/CMakeLists.txt | 4 ---- libsrc/webconfig/CMakeLists.txt | 4 +--- src/hyperion-aml/CMakeLists.txt | 3 +-- src/hyperion-dispmanx/CMakeLists.txt | 3 +-- src/hyperion-framebuffer/CMakeLists.txt | 3 +-- src/hyperion-osx/CMakeLists.txt | 3 +-- src/hyperion-remote/CMakeLists.txt | 2 +- src/hyperion-v4l2/CMakeLists.txt | 3 +-- src/hyperion-x11/CMakeLists.txt | 3 +-- 14 files changed, 23 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 320b2286..5e34b8fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,11 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0.0) PROJECT(hyperion) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) +# auto prepare .qrc files +set(CMAKE_AUTORCC ON) IF ( POLICY CMP0026 ) CMAKE_POLICY( SET CMP0026 OLD ) diff --git a/CompileHowto.md b/CompileHowto.md index 9a125efe..affa4871 100644 --- a/CompileHowto.md +++ b/CompileHowto.md @@ -6,6 +6,13 @@ sudo apt-get update sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev ``` +### Ubuntu 14.04 specific +You need a never version of cmake (minimum 3.0.0). Install it from the ppa or website +``` +sudo apt-get install software-properties-common +sudo add-apt-repository ppa:george-edison55/cmake-3.x +sudo apt-get update && sudo apt-get upgrade +``` **on RPI you need the videocore IV headers** diff --git a/libsrc/effectengine/CMakeLists.txt b/libsrc/effectengine/CMakeLists.txt index f2a33c9d..9a6b1652 100644 --- a/libsrc/effectengine/CMakeLists.txt +++ b/libsrc/effectengine/CMakeLists.txt @@ -21,10 +21,8 @@ CONFIGURE_FILE(${CURRENT_SOURCE_DIR}/EffectEngine.qrc.in ${CMAKE_BINARY_DIR}/Eff SET(EffectEngine_RESOURCES ${CMAKE_BINARY_DIR}/EffectEngine.qrc) -qt5_add_resources(EffectEngine_RESOURCES_RCC ${EffectEngine_RESOURCES} ) # OPTIONS "-no-compress" - add_library(effectengine - ${EffectEngine_RESOURCES_RCC} + ${EffectEngine_RESOURCES} ${EffectEngineSOURCES} ) diff --git a/libsrc/hyperion/CMakeLists.txt b/libsrc/hyperion/CMakeLists.txt index a974d91f..428d7738 100644 --- a/libsrc/hyperion/CMakeLists.txt +++ b/libsrc/hyperion/CMakeLists.txt @@ -5,11 +5,11 @@ SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/hyperion) FILE ( GLOB Hyperion_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" ) -QT5_ADD_RESOURCES(Hyperion_RESOURCES_RCC ${CURRENT_SOURCE_DIR}/resource.qrc OPTIONS "-no-compress") +SET(Hyperion_RESOURCES ${CURRENT_SOURCE_DIR}/resource.qrc) add_library(hyperion ${Hyperion_SOURCES} - ${Hyperion_RESOURCES_RCC} + ${Hyperion_RESOURCES} ) target_link_libraries(hyperion diff --git a/libsrc/leddevice/CMakeLists.txt b/libsrc/leddevice/CMakeLists.txt index 03e799f3..e2169677 100755 --- a/libsrc/leddevice/CMakeLists.txt +++ b/libsrc/leddevice/CMakeLists.txt @@ -15,7 +15,7 @@ include_directories( dev_tinker ) -FILE ( GLOB Leddevice_SOURCES +FILE ( GLOB Leddevice_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" @@ -51,12 +51,9 @@ endif() set(LedDevice_RESOURCES ${CURRENT_SOURCE_DIR}/LedDeviceSchemas.qrc ) -qt5_add_resources(LedDevice_RESOURCES_RCC ${LedDevice_RESOURCES} OPTIONS "-no-compress") - -SET( Leddevice_SOURCES +SET( Leddevice_SOURCES ${Leddevice_SOURCES} ${LedDevice_RESOURCES} - ${LedDevice_RESOURCES_RCC} ${Leddevice_USB_HID_SOURCES} ${Leddevice_TINKER_SOURCES} ${Leddevice_SPI_SOURCES} @@ -101,4 +98,3 @@ if (ENABLE_USB_HID) target_link_libraries(leddevice ${LIBUSB_1_LIBRARIES} hidapi-libusb) endif() endif() - diff --git a/libsrc/utils/CMakeLists.txt b/libsrc/utils/CMakeLists.txt index 00913cb4..a1483ec6 100644 --- a/libsrc/utils/CMakeLists.txt +++ b/libsrc/utils/CMakeLists.txt @@ -11,13 +11,9 @@ endif() set(Utils_RESOURCES ${CURRENT_SOURCE_DIR}/JSONRPC_schemas.qrc ) -qt5_add_resources(Utils_RESOURCES_RCC ${Utils_RESOURCES} OPTIONS "-no-compress") - - add_library(hyperion-utils ${Utils_SOURCES} ${Utils_RESOURCES} - ${Utils_RESOURCES_RCC} ) target_link_libraries(hyperion-utils diff --git a/libsrc/webconfig/CMakeLists.txt b/libsrc/webconfig/CMakeLists.txt index 278e3d30..51e99367 100644 --- a/libsrc/webconfig/CMakeLists.txt +++ b/libsrc/webconfig/CMakeLists.txt @@ -13,11 +13,9 @@ ENDFOREACH() CONFIGURE_FILE(${CURRENT_SOURCE_DIR}/WebConfig.qrc.in ${CMAKE_BINARY_DIR}/WebConfig.qrc ) SET(WebConfig_RESOURCES ${CMAKE_BINARY_DIR}/WebConfig.qrc) -qt5_add_resources(WebConfig_RESOURCES_RCC ${WebConfig_RESOURCES} ) #OPTIONS "-no-compress" - add_library(webconfig ${WebConfig_SOURCES} - ${WebConfig_RESOURCES_RCC} + ${WebConfig_RESOURCES} ) target_link_libraries(webconfig diff --git a/src/hyperion-aml/CMakeLists.txt b/src/hyperion-aml/CMakeLists.txt index a5feeded..48516408 100644 --- a/src/hyperion-aml/CMakeLists.txt +++ b/src/hyperion-aml/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0.0) project(hyperion-aml) find_package(Qt5Widgets REQUIRED) @@ -30,7 +30,6 @@ target_link_libraries(${PROJECT_NAME} protoserver amlogic-grabber framebuffer-grabber - pthread Qt5::Core Qt5::Gui Qt5::Network diff --git a/src/hyperion-dispmanx/CMakeLists.txt b/src/hyperion-dispmanx/CMakeLists.txt index 8f441afa..a35dfd1c 100644 --- a/src/hyperion-dispmanx/CMakeLists.txt +++ b/src/hyperion-dispmanx/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0.0) project(hyperion-dispmanx) find_package(Qt5Widgets REQUIRED) @@ -37,7 +37,6 @@ target_link_libraries( ${PROJECT_NAME} protoserver dispmanx-grabber ${Dispmanx_LIBRARIES} - pthread Qt5::Core Qt5::Gui Qt5::Network diff --git a/src/hyperion-framebuffer/CMakeLists.txt b/src/hyperion-framebuffer/CMakeLists.txt index 39a09e71..452604d6 100644 --- a/src/hyperion-framebuffer/CMakeLists.txt +++ b/src/hyperion-framebuffer/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0.0) project(hyperion-framebuffer) find_package(Qt5Widgets REQUIRED) @@ -29,7 +29,6 @@ target_link_libraries( ${PROJECT_NAME} hyperion-utils protoserver framebuffer-grabber - pthread Qt5::Core Qt5::Gui Qt5::Network diff --git a/src/hyperion-osx/CMakeLists.txt b/src/hyperion-osx/CMakeLists.txt index 9f13ab8a..69b78ff4 100644 --- a/src/hyperion-osx/CMakeLists.txt +++ b/src/hyperion-osx/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0.0) project(hyperion-osx) find_package(Qt5Widgets REQUIRED) @@ -29,7 +29,6 @@ target_link_libraries( ${PROJECT_NAME} hyperion-utils protoserver osx-grabber - pthread Qt5::Core Qt5::Gui Qt5::Network diff --git a/src/hyperion-remote/CMakeLists.txt b/src/hyperion-remote/CMakeLists.txt index ec3a67f9..2f7cbbae 100644 --- a/src/hyperion-remote/CMakeLists.txt +++ b/src/hyperion-remote/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0.0) project(hyperion-remote) find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED) diff --git a/src/hyperion-v4l2/CMakeLists.txt b/src/hyperion-v4l2/CMakeLists.txt index 6a971a70..f768dd0c 100644 --- a/src/hyperion-v4l2/CMakeLists.txt +++ b/src/hyperion-v4l2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0.0) project(hyperion-v4l2) find_package(Qt5Widgets REQUIRED) @@ -29,7 +29,6 @@ target_link_libraries(${PROJECT_NAME} blackborder hyperion-utils protoserver - pthread Qt5::Core Qt5::Gui Qt5::Network diff --git a/src/hyperion-x11/CMakeLists.txt b/src/hyperion-x11/CMakeLists.txt index 7c9e4214..a38bdfda 100644 --- a/src/hyperion-x11/CMakeLists.txt +++ b/src/hyperion-x11/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0.0) project(hyperion-x11) find_package(Qt5Widgets REQUIRED) @@ -33,7 +33,6 @@ target_link_libraries(${PROJECT_NAME} x11-grabber ${X11_LIBRARIES} ${X11_Xrender_LIB} - pthread Qt5::Core Qt5::Gui Qt5::Network