From 0ceef4cb54be9b7bb927e2f746d210a0b9fcac59 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 30 Sep 2019 13:22:15 +0200 Subject: Always append extra cmake modules to CMAKE_MODULE_PATH in Qt6Config During a static build we need to use the find modules in 3rdparty/extra-cmake-modules/find-modules when generating a ModuleDependencies file, so that the generated find_dependency() calls succeed. This means that the files have to be shipped with Qt6 package, making them pseudo public API. There is also a need to use these files when building QtWayland. Instead of setting / unsetting CMAKE_MODULE_PATH only in module and plugin Dependencies cmake files, just set them once when finding Qt6. This will allow QtWayland and QtX11Extras to easily find the required third party packages, without having to hardcode the paths in multiple repos. Change-Id: I750d0421a269e5632afa1bb62498c2501d73cdb1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- cmake/QtConfig.cmake.in | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmake/QtConfig.cmake.in') diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index 2a3c862d94..efce91d1c4 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -25,6 +25,12 @@ endif() # return() # endif() +get_filename_component(_qt_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_qt_import_prefix "${_qt_import_prefix}" REALPATH) +list(APPEND CMAKE_MODULE_PATH "${_qt_import_prefix}") +list(APPEND CMAKE_MODULE_PATH "${_qt_import_prefix}/3rdparty/extra-cmake-modules/find-modules") +list(APPEND CMAKE_MODULE_PATH "${_qt_import_prefix}/3rdparty/kwin") + foreach(module ${@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS}) find_package(@INSTALL_CMAKE_NAMESPACE@${module} ${_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_QUIET} -- cgit v1.2.3