diff options
-rw-r--r-- | cmake/QtConfig.cmake.in | 6 | ||||
-rw-r--r-- | cmake/QtModuleDependencies.cmake.in | 10 | ||||
-rw-r--r-- | cmake/QtPluginDependencies.cmake.in | 10 |
3 files changed, 6 insertions, 20 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} diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in index c9cfa9e752..ffb9e8a5d3 100644 --- a/cmake/QtModuleDependencies.cmake.in +++ b/cmake/QtModuleDependencies.cmake.in @@ -1,10 +1,3 @@ -# Save old module path, and append a new path that points to the copied over Find modules -# so that find_dependency() can find the third party packages. -set(old_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}") -list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@") -list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/3rdparty/extra-cmake-modules/find-modules") -list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/3rdparty/kwin") - # note: _third_party_deps example: "ICU\\;1.0\\;i18n uc data;ZLIB\\;\\;" set(_third_party_deps "@third_party_deps@") @@ -30,9 +23,6 @@ foreach(_target_dep ${_third_party_deps}) endif() endforeach() -# Restore old module path. -set(CMAKE_MODULE_PATH "${old_CMAKE_MODULE_PATH}") - # Find Qt tool package. set(_tool_deps "@main_module_tool_deps@") diff --git a/cmake/QtPluginDependencies.cmake.in b/cmake/QtPluginDependencies.cmake.in index 0dd6ba5a08..5be4a8ca3e 100644 --- a/cmake/QtPluginDependencies.cmake.in +++ b/cmake/QtPluginDependencies.cmake.in @@ -1,10 +1,3 @@ -# Save old module path, and append a new path that points to the copied over Find modules -# so that find_dependency() can find the third party packages. -set(old_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}") -list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@") -list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/3rdparty/extra-cmake-modules/find-modules") -list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/3rdparty/kwin") - # note: _third_party_deps example: "ICU\\;1.0\\;i18n uc data;ZLIB\\;\\;" set(_third_party_deps "@third_party_deps@") @@ -32,9 +25,6 @@ foreach(_target_dep ${_third_party_deps}) endif() endforeach() -# Restore old module path. -set(CMAKE_MODULE_PATH "${old_CMAKE_MODULE_PATH}") - # note: target_deps example: "Qt6Core\;5.12.0;Qt6Gui\;5.12.0" set(_target_deps "@target_deps@") foreach(_target_dep ${_target_deps}) |