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>
This commit is contained in:
parent
76f5b784ce
commit
a859cb508c
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user