diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-09-30 13:22:15 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-01 12:05:59 +0000 |
commit | 0ceef4cb54be9b7bb927e2f746d210a0b9fcac59 (patch) | |
tree | f93487715962e4f633d676b14280d089e65be61a /cmake/QtConfig.cmake.in | |
parent | 3886828c1fc038a1f10924e5eb704cdc47c7d435 (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 <simon.hausmann@qt.io>
Diffstat (limited to 'cmake/QtConfig.cmake.in')
-rw-r--r-- | cmake/QtConfig.cmake.in | 6 |
1 files changed, 6 insertions, 0 deletions
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} |