path: root/cmake/
diff options
authorAlexandru Croitor <>2019-09-30 13:22:15 +0200
committerAlexandru Croitor <>2019-10-01 12:05:59 +0000
commit0ceef4cb54be9b7bb927e2f746d210a0b9fcac59 (patch)
treef93487715962e4f633d676b14280d089e65be61a /cmake/
parent3886828c1fc038a1f10924e5eb704cdc47c7d435 (diff)
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 <>
Diffstat (limited to 'cmake/')
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/ b/cmake/
index 2a3c862d94..efce91d1c4 100644
--- a/cmake/
+++ b/cmake/
@@ -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")