Update CMake to only look for Qt5 if RESINSIGHT_BUILD_WITH_QT5 is set

This commit is contained in:
Gaute Lindkvist 2018-12-10 14:49:38 +01:00
parent 81e2132752
commit 17e12a92a0
18 changed files with 75 additions and 19 deletions

View File

@ -5,7 +5,10 @@ project (ApplicationCode)
# Open GL
find_package( OpenGL )
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui OpenGL Network Script Widgets)
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Script Qt5::Widgets)

View File

@ -2,7 +2,10 @@ cmake_minimum_required (VERSION 2.8.12)
project (WellPathImportSsihub)
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Network)
else()

View File

@ -232,13 +232,20 @@ list(APPEND THIRD_PARTY_LIBRARIES
################################################################################
# Qt
################################################################################
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
message(STATUS "Attempting to build with Qt5")
find_package(Qt5 COMPONENTS Core QUIET)
else()
message(STATUS "Attempting to build with Qt4")
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
message(STATUS "Found Qt5")
find_package (Qt5 CONFIG REQUIRED Core Widgets OpenGL Network Script ScriptTools)
else()
message(STATUS "No Qt5 found, trying Qt4")
if (RESINSIGHT_BUILD_WITH_QT5)
message("Could not find Qt5. Trying with Qt4")
endif(RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt4 COMPONENTS QtCore QtGui QtMain REQUIRED)
if (QT_VERSION_MINOR LESS 6)
message(FATAL_ERROR "Qt 4.6 is required, please specify qmake for variable QT_QMAKE_EXECUTABLE")

View File

@ -3,7 +3,10 @@ cmake_minimum_required (VERSION 2.8.12)
project (CommonCode)
# Qt
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui OpenGL Widgets)
else()

View File

@ -2,7 +2,10 @@ cmake_minimum_required (VERSION 2.8.12)
project (cafAnimControl)
# Qt
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui Widgets)
else()

View File

@ -1,7 +1,10 @@
cmake_minimum_required (VERSION 2.8.12)
# Qt
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui Widgets)
else()

View File

@ -3,7 +3,10 @@ cmake_minimum_required (VERSION 2.8.12)
project (cafPdmCvf)
# Qt
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui Widgets)
else()

View File

@ -3,7 +3,10 @@ cmake_minimum_required (VERSION 2.8.12)
project (cafProjectDataModel)
# Qt
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui Widgets)
else()

View File

@ -3,7 +3,10 @@ cmake_minimum_required (VERSION 2.8.12)
project (cafPdmCore)
# Qt
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core)
else()

View File

@ -3,7 +3,10 @@ cmake_minimum_required (VERSION 2.8.12)
project (cafPdmUiCore)
# Qt
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui Widgets)
else()

View File

@ -3,7 +3,10 @@ cmake_minimum_required (VERSION 2.8.12)
project (cafPdmXml)
# Qt
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Xml)
else()

View File

@ -8,7 +8,10 @@ endif (MSVC)
project (cafUserInterface)
# Qt
find_package(Qt5 COMPONENTS Core QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui Widgets)
else()

View File

@ -3,7 +3,10 @@ cmake_minimum_required (VERSION 2.8.12)
project (cafViewer)
# Qt
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui OpenGL Widgets)
else()

View File

@ -5,8 +5,10 @@ project (cafVizExtensions)
# Open GL
find_package( OpenGL )
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5Core CONFIG QUIET)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui OpenGL Widgets)
else()

View File

@ -10,8 +10,10 @@ if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long")
endif()
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5Core CONFIG QUIET)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Gui OpenGL Widgets)
else()

View File

@ -7,7 +7,10 @@ if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
endif()
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Concurrent Core OpenGL PrintSupport Widgets)
else()

View File

@ -7,7 +7,10 @@ if(MSVC)
message(STATUS "MSVC: Enabled increased number of sections in object files")
endif()
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core)
else()

View File

@ -2,7 +2,10 @@ cmake_minimum_required (VERSION 2.8.12)
project (nightcharts)
find_package(Qt5Core CONFIG QUIET)
if (RESINSIGHT_BUILD_WITH_QT5)
find_package(Qt5 COMPONENTS Core QUIET)
endif(RESINSIGHT_BUILD_WITH_QT5)
if (Qt5Core_FOUND)
find_package(Qt5 CONFIG REQUIRED Core Widgets)
else()