diff --git a/doc/src/development/cmake-manual.qdoc b/doc/src/development/cmake-manual.qdoc index b0f856ac2660f9cbfa7248c28c527176364ecdd5..99b72cfef5d33445f30d65014ad613631c3da486 100644 --- a/doc/src/development/cmake-manual.qdoc +++ b/doc/src/development/cmake-manual.qdoc @@ -56,8 +56,8 @@ \snippet snippets/cmake/CMakeLists.pro 0 In order for \c{find_package} to be successful, Qt 5 must be found below the CMAKE_PREFIX_PATH, - or the Qt5<Module>_DIR must be set in the \c{CMake} cache to the location of the - Qt5WidgetsConfig.cmake file. The easiest way to use \c{CMake} is to set the CMAKE_PREFIX_PATH + or the \c{Qt5_DIR} must be set in the \c{CMake} cache to the location of the + \c{Qt5Config.cmake} file. The easiest way to use \c{CMake} is to set the CMAKE_PREFIX_PATH environment variable to the install prefix of Qt 5. The CMAKE_AUTOMOC setting runs moc automatically when required. For more on this feature see @@ -105,7 +105,8 @@ for use. The name of the imported target for each module matches the name of the module with a prefix of 'Qt5::', for example Qt5::Widgets. All of the package-specific variables have a consistent name with a prefix of the name of the package. For example, - \c{find_package}(Qt5Widgets) will make the following variables available if successfully found: + \c{find_package(Qt5 COMPONENTS Widgets)} will make the following variables available + if successfully found: \list \li Qt5Widgets_VERSION String describing the version of the module. diff --git a/doc/src/snippets/cmake/CMakeLists.pro b/doc/src/snippets/cmake/CMakeLists.pro index b2018342161343cb2236465d220ccc9babafc07c..6f66cabf9cf9ce8e48f848b2cd6291ab2edf066f 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")