CMake: get rid of QT_EXTRA_LIBRARIES

This can be easily derived from QT_EXTRA_COMPONENTS.

Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
This commit is contained in:
Rolf Eike Beer 2019-03-07 22:27:22 +01:00 committed by Dirk Hohndel
parent 17211acc53
commit 62c6a19744
3 changed files with 5 additions and 9 deletions

View file

@ -160,7 +160,6 @@ if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable")
set(SUBSURFACE_TARGET subsurface) set(SUBSURFACE_TARGET subsurface)
endif() endif()
list(APPEND QT_EXTRA_COMPONENTS QuickWidgets) list(APPEND QT_EXTRA_COMPONENTS QuickWidgets)
list(APPEND QT_EXTRA_LIBRARIES Qt5::QuickWidgets)
remove_definitions(-DSUBSURFACE_MOBILE) remove_definitions(-DSUBSURFACE_MOBILE)
elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable") elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
@ -169,7 +168,6 @@ elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable")
set(SUBSURFACE_TARGET subsurface-mobile) set(SUBSURFACE_TARGET subsurface-mobile)
endif() endif()
list(APPEND QT_EXTRA_COMPONENTS QuickControls2) list(APPEND QT_EXTRA_COMPONENTS QuickControls2)
list(APPEND QT_EXTRA_LIBRARIES Qt5::QuickControls2)
add_definitions(-DSUBSURFACE_MOBILE) add_definitions(-DSUBSURFACE_MOBILE)
message(STATUS "Building Subsurface-mobile requires BT support") message(STATUS "Building Subsurface-mobile requires BT support")
set(BTSUPPORT ON) set(BTSUPPORT ON)
@ -178,7 +176,6 @@ endif()
if(ANDROID) if(ANDROID)
set(NO_PRINTING ON) set(NO_PRINTING ON)
list(APPEND QT_EXTRA_COMPONENTS AndroidExtras) list(APPEND QT_EXTRA_COMPONENTS AndroidExtras)
list(APPEND QT_EXTRA_LIBRARIES Qt5::AndroidExtras)
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -llog) set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -llog)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# add pthread to the end of the library list on Linux # add pthread to the end of the library list on Linux
@ -229,7 +226,6 @@ endif()
if(BTSUPPORT) if(BTSUPPORT)
list(APPEND QT_EXTRA_COMPONENTS Bluetooth) list(APPEND QT_EXTRA_COMPONENTS Bluetooth)
list(APPEND QT_EXTRA_LIBRARIES Qt5::Bluetooth)
endif() endif()
if(ANDROID) if(ANDROID)
@ -238,8 +234,11 @@ if(ANDROID)
# our Qt installation. This is ugly, but it works. # our Qt installation. This is ugly, but it works.
set(CMAKE_FIND_ROOT_PATH "/;${CMAKE_FIND_ROOT_PATH}") set(CMAKE_FIND_ROOT_PATH "/;${CMAKE_FIND_ROOT_PATH}")
endif() endif()
find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network Svg Test QuickTest LinguistTools Positioning Quick Location ${QT_EXTRA_COMPONENTS}) set(QT_FIND_COMPONENTS Core Concurrent Widgets Network Svg 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}) 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) set(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test Qt5::QuickTest)
#disable bluetooth if Qt version is ancient. #disable bluetooth if Qt version is ancient.

View file

@ -11,5 +11,4 @@ else()
set(GRANTLEE_LIBRARIES Grantlee5::Templates) set(GRANTLEE_LIBRARIES Grantlee5::Templates)
endif() endif()
LIST(APPEND QT_EXTRA_COMPONENTS PrintSupport) LIST(APPEND QT_EXTRA_COMPONENTS PrintSupport)
LIST(APPEND QT_EXTRA_LIBRARIES Qt5::PrintSupport)
endif() endif()

View file

@ -5,10 +5,8 @@ else()
if(USE_WEBENGINE) if(USE_WEBENGINE)
message(STATUS "building with QWebEngine") message(STATUS "building with QWebEngine")
list(APPEND QT_EXTRA_COMPONENTS WebEngineWidgets) list(APPEND QT_EXTRA_COMPONENTS WebEngineWidgets)
list(APPEND QT_EXTRA_LIBRARIES Qt5::WebEngineWidgets)
add_definitions(-DUSE_WEBENGINE) add_definitions(-DUSE_WEBENGINE)
else() else()
list(APPEND QT_EXTRA_COMPONENTS WebKitWidgets) list(APPEND QT_EXTRA_COMPONENTS WebKitWidgets)
list(APPEND QT_EXTRA_LIBRARIES Qt5::WebKitWidgets)
endif() endif()
endif() endif()