better qt targets unification

This commit is contained in:
Martin Rotter 2022-02-01 12:15:36 +01:00
parent 3c73b3f91f
commit 2d767afea9
3 changed files with 15 additions and 17 deletions

View File

@ -143,11 +143,9 @@ if(UNIX AND NOT APPLE AND NOT ANDROID)
endif()
if(BUILD_WITH_QT6)
set(QTTAR Qt)
find_package(QT NAMES Qt6)
find_package(Qt6 COMPONENTS ${QT_COMPONENTS} Core5Compat REQUIRED)
else()
set(QTTAR Qt5)
find_package(QT NAMES Qt5)
find_package(Qt5 COMPONENTS ${QT_COMPONENTS} REQUIRED)

View File

@ -530,36 +530,36 @@ target_include_directories(rssguard
)
target_link_libraries(rssguard PUBLIC
${QTTAR}::Core
${QTTAR}::Gui
${QTTAR}::Network
${QTTAR}::Qml
${QTTAR}::Sql
${QTTAR}::Widgets
${QTTAR}::Xml
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::Qml
Qt${QT_VERSION_MAJOR}::Sql
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Xml
)
if(QT_VERSION_MAJOR EQUAL 6)
target_link_libraries(rssguard PUBLIC
${QTTAR}::Core5Compat
Qt${QT_VERSION_MAJOR}::Core5Compat
)
endif()
if(USE_WEBENGINE)
target_link_libraries(rssguard PUBLIC
${QTTAR}::WebEngineWidgets
Qt${QT_VERSION_MAJOR}::WebEngineWidgets
)
endif()
if(NOT OS2)
target_link_libraries(rssguard PUBLIC
${QTTAR}::Multimedia
Qt${QT_VERSION_MAJOR}::Multimedia
)
endif()
if(UNIX AND NOT APPLE AND NOT ANDROID)
target_link_libraries(rssguard PUBLIC
${QTTAR}::DBus
Qt${QT_VERSION_MAJOR}::DBus
)
endif()

View File

@ -14,15 +14,15 @@ target_include_directories(app PUBLIC
)
target_link_libraries(app PUBLIC
${QTTAR}::Core
${QTTAR}::Gui
${QTTAR}::Widgets
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets
rssguard
)
if(QT_VERSION_MAJOR EQUAL 6)
target_link_libraries(app PUBLIC
${QTTAR}::Core5Compat
Qt${QT_VERSION_MAJOR}::Core5Compat
)
endif()