summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-05-20 09:46:38 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-05-20 13:48:16 +0000
commita859cb508ce7152c107acd251b45c3213659903c (patch)
tree8cb050e8f80acf093c3ea15dbd3e2248ad60ba7d /cmake
parent76f5b784ce54730ed8d6ad4bb9c39c9a05c5d81d (diff)
Automatically install repo specific cmake find modules
Some qt modules need to find 3rd party packages for which there are no Config files. We need to write custom CMake Find modules to find those packages. These find modules need to be installed so that they are used when a user consumes the Qt packages. Automatically include and install these find modules if they exist, as part of qt_build_repo_end(). Change-Id: I14aad35ed2999cac8bdda65ca4aeaf74d04fdb71 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuildInternals/QtBuildInternalsConfig.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
index a3b7bddb1a..34e40365ca 100644
--- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
+++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
@@ -19,6 +19,11 @@ macro(qt_build_repo_begin)
# Set up the paths for the modules.
set(QT_CMAKE_MODULE_PATH "${QT_BUILD_INTERNALS_PATH}/../${QT_CMAKE_EXPORT_NAMESPACE}")
list(APPEND CMAKE_MODULE_PATH ${QT_CMAKE_MODULE_PATH})
+
+ # If the repo has its own cmake modules, include those in the module path.
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ endif()
endif()
# Qt specific setup common for all modules:
@@ -30,6 +35,16 @@ macro(qt_build_repo_end)
# Delayed actions on some of the Qt targets:
include(QtPostProcess)
+ # Install the repo-specific cmake find modules.
+ qt_path_join(__qt_repo_install_dir ${QT_CONFIG_INSTALL_DIR} ${INSTALL_CMAKE_NAMESPACE})
+
+ if(NOT PROJECT_NAME STREQUAL "QtBase")
+ qt_copy_or_install(DIRECTORY cmake/
+ DESTINATION "${__qt_repo_install_dir}"
+ FILES_MATCHING PATTERN "Find*.cmake"
+ )
+ endif()
+
# Print a feature summary:
feature_summary(WHAT PACKAGES_FOUND
REQUIRED_PACKAGES_NOT_FOUND