From 2bd21f8365eb0c199671d35acc64eb25552b2dc2 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 9 Apr 2019 10:02:48 +0200 Subject: CMake: Advocate find_packages(Qt5 COMPONENTS ...) style This is the style cmake-qt documentation shows nowadays. For motivation see also https://blog.kitware.com/cmake-finding-qt5-the-right-way/ Change-Id: I47651c58387b8bf96a2235395f0321e54ad05a88 Reviewed-by: Tobias Hunger Reviewed-by: Leena Miettinen Reviewed-by: Alexandru Croitor --- doc/src/snippets/cmake/CMakeLists.pro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/src/snippets') diff --git a/doc/src/snippets/cmake/CMakeLists.pro b/doc/src/snippets/cmake/CMakeLists.pro index b20183421..6f66cabf9 100644 --- a/doc/src/snippets/cmake/CMakeLists.pro +++ b/doc/src/snippets/cmake/CMakeLists.pro @@ -11,7 +11,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) # Find the QtWidgets library -find_package(Qt5Widgets CONFIG REQUIRED) +find_package(Qt5 COMPONENTS Widgets REQUIRED) # Populate a CMake variable with the sources set(helloworld_SRCS @@ -26,13 +26,13 @@ target_link_libraries(helloworld Qt5::Widgets) #! [0] #! [1] -find_package(Qt5Core) +find_package(Qt5 COMPONENTS Core REQUIRED) get_target_property(QtCore_location Qt5::Core LOCATION) #! [1] #! [2] -find_package(Qt5Core) +find_package(Qt5 COMPONENTS Core REQUIRED) set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-arcs -ftest-coverage") -- cgit v1.2.3