Add Qt5 test to AppFwk main CMakeLists.txt and update CAF to use CEE_USE_QT5

This commit is contained in:
Gaute Lindkvist
2019-05-28 09:08:32 +02:00
parent c7a9f64575
commit 8f3eb6a748
13 changed files with 151 additions and 111 deletions

View File

@@ -3,12 +3,19 @@ cmake_minimum_required (VERSION 2.8.12)
project (cafPdmXml)
# Qt
if (CAF_USE_QT5)
find_package(Qt5 COMPONENTS Core Xml REQUIRED)
option(CEE_USE_QT5 "Use Qt5" OFF)
if (CEE_USE_QT5)
find_package(Qt5Core CONFIG QUIET)
endif(CEE_USE_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Xml)
set(QT_LIBRARIES Qt5::Core Qt5::Xml)
else()
find_package(Qt4 COMPONENTS QtCore QtXml REQUIRED)
find_package(Qt4 COMPONENTS QtCore QtXml REQUIRED)
include(${QT_USE_FILE})
endif(CAF_USE_QT5)
endif(Qt5Core_FOUND)
include_directories (
..
@@ -48,10 +55,6 @@ add_library( ${PROJECT_NAME}
${PROJECT_FILES}
)
if (CAF_USE_QT5)
set(QT_LIBRARIES Qt5::Core Qt5::Xml)
endif(CAF_USE_QT5)
target_link_libraries ( ${PROJECT_NAME}
cafPdmCore
${QT_LIBRARIES}