mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
added optional QT5 support - LedDevicePhilipsHue needs proper fixes
Former-commit-id: 7f0971ccda221933da4be836628532e7cfc7c085
This commit is contained in:
@@ -37,6 +37,9 @@ message(STATUS "ENABLE_WS2812BPWM = " ${ENABLE_WS2812BPWM})
|
||||
option(ENABLE_X11 "Enable the X11 grabber" OFF)
|
||||
message(STATUS "ENABLE_X11 = " ${ENABLE_X11})
|
||||
|
||||
option(ENABLE_QT5 "Enable QT5" OFF)
|
||||
message(STATUS "ENABLE_QT5 = " ${ENABLE_QT5})
|
||||
|
||||
if(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF)
|
||||
message(FATAL_ERROR "V4L2 grabber requires PROTOBUF. Disable V4L2 or enable PROTOBUF")
|
||||
endif(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF)
|
||||
@@ -53,6 +56,10 @@ if(ENABLE_OSX AND ENABLE_DISPMANX)
|
||||
message(FATAL_ERROR "dispmanx grabber and osx grabber cannot be used at the same time")
|
||||
endif(ENABLE_OSX AND ENABLE_DISPMANX)
|
||||
|
||||
#if(ENABLE_QT5)
|
||||
# TODO vs ENABLE_QT4?
|
||||
#endif(ENABLE_QT5)
|
||||
|
||||
# Createt the configuration file
|
||||
# configure a header file to pass some of the CMake settings
|
||||
# to the source code
|
||||
@@ -61,8 +68,14 @@ include_directories("${PROJECT_BINARY_DIR}")
|
||||
|
||||
# Add project specific cmake modules (find, etc)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
if(ENABLE_QT5)
|
||||
ADD_DEFINITIONS ( -DENABLE_QT5 )
|
||||
#find_package(Qt5Widgets)
|
||||
else(ENABLE_QT5)
|
||||
# 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)
|
||||
endif(ENABLE_QT5)
|
||||
|
||||
# Define the global output path of binaries
|
||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
|
||||
@@ -85,15 +98,27 @@ set(CMAKE_BUILD_TYPE "Debug")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall")
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11 -Wall")
|
||||
|
||||
if(ENABLE_QT5)
|
||||
#find_package(Qt5Core 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 "-fPIC")
|
||||
else(ENABLE_QT5)
|
||||
# Configure the use of QT4
|
||||
find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED QUIET)
|
||||
endif(ENABLE_QT5)
|
||||
|
||||
#add libusb and pthreads
|
||||
find_package(libusb-1.0 REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
if(ENABLE_QT5)
|
||||
#include(${QT_USE_FILE})
|
||||
add_definitions(${QT_DEFINITIONS})
|
||||
else(ENABLE_QT5)
|
||||
include(${QT_USE_FILE})
|
||||
add_definitions(${QT_DEFINITIONS})
|
||||
endif(ENABLE_QT5)
|
||||
|
||||
# TODO[TvdZ]: This linking directory should only be added if we are cross compiling
|
||||
if(NOT APPLE)
|
||||
link_directories(${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf)
|
||||
|
Reference in New Issue
Block a user