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 --- tests/hawd/CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/hawd') diff --git a/tests/hawd/CMakeLists.txt b/tests/hawd/CMakeLists.txt index 6ae5f13..7546920 100644 --- a/tests/hawd/CMakeLists.txt +++ b/tests/hawd/CMakeLists.txt @@ -27,8 +27,7 @@ set(SRCS add_library(lib${PROJECT_NAME} SHARED ${lib_SRCS}) generate_export_header(lib${PROJECT_NAME} BASE_NAME HAWD EXPORT_FILE_NAME hawd_export.h) -qt5_use_modules(lib${PROJECT_NAME} Core) -target_link_libraries(lib${PROJECT_NAME} sink) +target_link_libraries(lib${PROJECT_NAME} sink Qt5::Core) if (LIBGIT2_FOUND) target_link_libraries(lib${PROJECT_NAME} ${LIBGIT2_LIBRARIES}) endif(LIBGIT2_FOUND) @@ -36,8 +35,7 @@ endif(LIBGIT2_FOUND) install(TARGETS lib${PROJECT_NAME} ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) add_executable(${PROJECT_NAME} ${SRCS}) -qt5_use_modules(${PROJECT_NAME} Core) -target_link_libraries(${PROJECT_NAME} lib${PROJECT_NAME}) +target_link_libraries(${PROJECT_NAME} lib${PROJECT_NAME} Qt5::Core) if (LIBGIT2_FOUND) target_link_libraries(${PROJECT_NAME} ${LIBGIT2_LIBRARIES}) endif(LIBGIT2_FOUND) -- cgit v1.2.3