From 51fbcca97ef9058cdb75c52ac77bdc728a296e4a Mon Sep 17 00:00:00 2001 From: Heiko Becker Date: Fri, 2 Jun 2017 21:35:37 +0200 Subject: Use imported targets instead of qt5_use_modules From Qt's documentation: "This macro is obsolete. Use target_link_libraries with IMPORTED targets instead." It's only recommended with cmake >=2.8.9 & < 2.8.12. Kube already requires cmake 3.0. One advantage of using the imported targets is, that cmake complains if a target isn't found before it's used, like Qt5Concurrent missing from the find_package_call here. Reviewers: #kube, cmollekopf Reviewed By: #kube, cmollekopf Subscribers: #kube Differential Revision: https://phabricator.kde.org/D6362 --- accounts/maildir/CMakeLists.txt | 20 +++++++++++++++----- accounts/maildir/tests/CMakeLists.txt | 9 +++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) (limited to 'accounts/maildir') diff --git a/accounts/maildir/CMakeLists.txt b/accounts/maildir/CMakeLists.txt index efd0ec6a..b321f0ad 100644 --- a/accounts/maildir/CMakeLists.txt +++ b/accounts/maildir/CMakeLists.txt @@ -19,7 +19,7 @@ include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings) -find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui) +find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Concurrent Quick Test Gui) find_package(Sink CONFIG REQUIRED) find_package(KAsync CONFIG REQUIRED) @@ -33,12 +33,22 @@ set(SRCS ) add_library(maildiraccountplugin SHARED ${SRCS}) -qt5_use_modules(maildiraccountplugin Core Quick Qml) -target_link_libraries(maildiraccountplugin sink frameworkplugin) +target_link_libraries(maildiraccountplugin + sink + frameworkplugin + Qt5::Core + Qt5::Quick + Qt5::Qml +) add_library(maildiraccount_static STATIC ${SRCS}) -qt5_use_modules(maildiraccount_static Core Quick Qml) -target_link_libraries(maildiraccount_static sink frameworkplugin) +target_link_libraries(maildiraccount_static + sink + frameworkplugin + Qt5::Core + Qt5::Quick + Qt5::Qml +) add_subdirectory(tests) kpackage_install_package(package org.kube.accounts.maildir "genericqml") diff --git a/accounts/maildir/tests/CMakeLists.txt b/accounts/maildir/tests/CMakeLists.txt index cc7651b3..2452e526 100644 --- a/accounts/maildir/tests/CMakeLists.txt +++ b/accounts/maildir/tests/CMakeLists.txt @@ -2,5 +2,10 @@ include_directories(../) cmake_policy(SET CMP0063 NEW) add_executable(settingstest settingstest.cpp) add_test(settingstest settingstest) -qt5_use_modules(settingstest Core Test Concurrent) -target_link_libraries(settingstest sink maildiraccount_static) +target_link_libraries(settingstest + sink + maildiraccount_static + Qt5::Core + Qt5::Test + Qt5::Concurrent +) -- cgit v1.2.3