diff options
author | Heiko Becker <heirecka@exherbo.org> | 2017-06-02 21:35:37 +0200 |
---|---|---|
committer | Heiko Becker <heirecka@exherbo.org> | 2017-07-29 11:01:28 +0200 |
commit | 51fbcca97ef9058cdb75c52ac77bdc728a296e4a (patch) | |
tree | 982206bd7c35353a10839802d237e53692fe7116 /framework/src/CMakeLists.txt | |
parent | ba32e5a606c77b968f53239caf276456c81b4db7 (diff) | |
download | kube-51fbcca97ef9058cdb75c52ac77bdc728a296e4a.tar.gz kube-51fbcca97ef9058cdb75c52ac77bdc728a296e4a.zip |
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
Diffstat (limited to 'framework/src/CMakeLists.txt')
-rw-r--r-- | framework/src/CMakeLists.txt | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/framework/src/CMakeLists.txt b/framework/src/CMakeLists.txt index 75357b68..034feba9 100644 --- a/framework/src/CMakeLists.txt +++ b/framework/src/CMakeLists.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | ||
2 | find_package(Qt5 COMPONENTS REQUIRED Core Qml) | 2 | find_package(Qt5 COMPONENTS REQUIRED Core Quick Qml WebEngineWidgets Test) |
3 | find_package(KF5Mime "4.87.0" CONFIG REQUIRED) | 3 | find_package(KF5Mime "4.87.0" CONFIG REQUIRED) |
4 | find_package(Sink CONFIG REQUIRED) | 4 | find_package(Sink CONFIG REQUIRED) |
5 | find_package(KAsync CONFIG REQUIRED) | 5 | find_package(KAsync CONFIG REQUIRED) |
@@ -43,8 +43,19 @@ set(SRCS | |||
43 | ) | 43 | ) |
44 | 44 | ||
45 | add_library(frameworkplugin SHARED ${SRCS}) | 45 | add_library(frameworkplugin SHARED ${SRCS}) |
46 | qt5_use_modules(frameworkplugin Core Quick Qml WebEngineWidgets Test) | 46 | target_link_libraries(frameworkplugin |
47 | target_link_libraries(frameworkplugin sink kube_otp KF5::Codecs KF5::Package KF5::Contacts KAsync) | 47 | sink |
48 | kube_otp | ||
49 | Qt5::Core | ||
50 | Qt5::Quick | ||
51 | Qt5::Qml | ||
52 | Qt5::WebEngineWidgets | ||
53 | Qt5::Test | ||
54 | KF5::Codecs | ||
55 | KF5::Contacts | ||
56 | KF5::Package | ||
57 | KAsync | ||
58 | ) | ||
48 | install(TARGETS frameworkplugin DESTINATION ${FRAMEWORK_INSTALL_DIR}) | 59 | install(TARGETS frameworkplugin DESTINATION ${FRAMEWORK_INSTALL_DIR}) |
49 | 60 | ||
50 | set(BUILD_TESTING ON) | 61 | set(BUILD_TESTING ON) |