diff options
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | cmake/Modules/HandleFindGrantlee.cmake | 1 | ||||
-rw-r--r-- | cmake/Modules/HandleUserManual.cmake | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bf03a09c..e57c1118a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,7 +160,6 @@ if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable") set(SUBSURFACE_TARGET subsurface) endif() list(APPEND QT_EXTRA_COMPONENTS QuickWidgets) - list(APPEND QT_EXTRA_LIBRARIES Qt5::QuickWidgets) remove_definitions(-DSUBSURFACE_MOBILE) elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") @@ -169,7 +168,6 @@ elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable") set(SUBSURFACE_TARGET subsurface-mobile) endif() list(APPEND QT_EXTRA_COMPONENTS QuickControls2) - list(APPEND QT_EXTRA_LIBRARIES Qt5::QuickControls2) add_definitions(-DSUBSURFACE_MOBILE) message(STATUS "Building Subsurface-mobile requires BT support") set(BTSUPPORT ON) @@ -178,7 +176,6 @@ endif() if(ANDROID) set(NO_PRINTING ON) list(APPEND QT_EXTRA_COMPONENTS AndroidExtras) - list(APPEND QT_EXTRA_LIBRARIES Qt5::AndroidExtras) set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -llog) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") # add pthread to the end of the library list on Linux @@ -229,7 +226,6 @@ endif() if(BTSUPPORT) list(APPEND QT_EXTRA_COMPONENTS Bluetooth) - list(APPEND QT_EXTRA_LIBRARIES Qt5::Bluetooth) endif() if(ANDROID) @@ -238,8 +234,11 @@ if(ANDROID) # our Qt installation. This is ugly, but it works. set(CMAKE_FIND_ROOT_PATH "/;${CMAKE_FIND_ROOT_PATH}") endif() -find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network Svg Test QuickTest LinguistTools Positioning Quick Location ${QT_EXTRA_COMPONENTS}) -set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::Svg Qt5::Positioning Qt5::Quick Qt5::Location ${QT_EXTRA_LIBRARIES}) +set(QT_FIND_COMPONENTS Core Concurrent Widgets Network Svg Positioning Quick Location ${QT_EXTRA_COMPONENTS}) +find_package(Qt5 REQUIRED COMPONENTS ${QT_FIND_COMPONENTS} LinguistTools Test QuickTest) +foreach(_QT_COMPONENT ${QT_FIND_COMPONENTS}) + list(APPEND QT_LIBRARIES Qt5::${_QT_COMPONENT}) +endforeach() set(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test Qt5::QuickTest) #disable bluetooth if Qt version is ancient. diff --git a/cmake/Modules/HandleFindGrantlee.cmake b/cmake/Modules/HandleFindGrantlee.cmake index ddc253840..ab0faf491 100644 --- a/cmake/Modules/HandleFindGrantlee.cmake +++ b/cmake/Modules/HandleFindGrantlee.cmake @@ -11,5 +11,4 @@ else() set(GRANTLEE_LIBRARIES Grantlee5::Templates) endif() LIST(APPEND QT_EXTRA_COMPONENTS PrintSupport) - LIST(APPEND QT_EXTRA_LIBRARIES Qt5::PrintSupport) endif() diff --git a/cmake/Modules/HandleUserManual.cmake b/cmake/Modules/HandleUserManual.cmake index a9354be2b..ba8b66331 100644 --- a/cmake/Modules/HandleUserManual.cmake +++ b/cmake/Modules/HandleUserManual.cmake @@ -5,10 +5,8 @@ else() if(USE_WEBENGINE) message(STATUS "building with QWebEngine") list(APPEND QT_EXTRA_COMPONENTS WebEngineWidgets) - list(APPEND QT_EXTRA_LIBRARIES Qt5::WebEngineWidgets) add_definitions(-DUSE_WEBENGINE) else() list(APPEND QT_EXTRA_COMPONENTS WebKitWidgets) - list(APPEND QT_EXTRA_LIBRARIES Qt5::WebKitWidgets) endif() endif() |