From 9e6952baf64b51fa7ddb6ac91d4ce79ebfd2b2df Mon Sep 17 00:00:00 2001 From: Heiko Becker Date: Sat, 13 May 2017 00:11:45 +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. Sink 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: #sink, cmollekopf Reviewed By: #sink, cmollekopf Subscribers: #sink Tags: #sink Differential Revision: https://phabricator.kde.org/D6361 --- examples/mailtransportresource/CMakeLists.txt | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'examples/mailtransportresource') diff --git a/examples/mailtransportresource/CMakeLists.txt b/examples/mailtransportresource/CMakeLists.txt index 03b89db..1c34676 100644 --- a/examples/mailtransportresource/CMakeLists.txt +++ b/examples/mailtransportresource/CMakeLists.txt @@ -10,13 +10,23 @@ include_directories(${CURL_INCLUDE_DIRS}) add_library(${PROJECT_NAME} SHARED mailtransportresource.cpp mailtransport.cpp) -qt5_use_modules(${PROJECT_NAME} Core Network) -target_link_libraries(${PROJECT_NAME} sink KF5::Mime ${CURL_LIBRARIES}) +target_link_libraries(${PROJECT_NAME} + sink + Qt5::Core + Qt5::Network + KF5::Mime + ${CURL_LIBRARIES} +) install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) add_executable(sink_smtp_test smtptest.cpp mailtransport.cpp) -qt5_use_modules(sink_smtp_test Core Network) -target_link_libraries(sink_smtp_test sink KF5::Mime ${CURL_LIBRARIES}) +target_link_libraries(sink_smtp_test + sink + Qt5::Core + Qt5::Network + KF5::Mime + ${CURL_LIBRARIES} +) install(TARGETS sink_smtp_test ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) add_subdirectory(tests) -- cgit v1.2.3