diff options
author | Kai Koehne <kai.koehne@qt.io> | 2019-04-09 10:02:48 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2019-04-24 12:59:08 +0000 |
commit | 2bd21f8365eb0c199671d35acc64eb25552b2dc2 (patch) | |
tree | bcd80f797b82257d8169f61e4d845edcced96f39 /doc/src/snippets | |
parent | 039c7d8a843328402c48410eb1f94358455bf9ce (diff) |
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 <tobias.hunger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'doc/src/snippets')
-rw-r--r-- | doc/src/snippets/cmake/CMakeLists.pro | 6 |
1 files changed, 3 insertions, 3 deletions
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") |