Load module specific extensions for QtBuildInternals

This patch enables each module to load their own
Qt${version}ModuleBuildInternals.cmake to expose module specific
features when building Qt.

These scripts are only loaded when the package QtBuildInternals has been
loaded.

Change-Id: Ie58dd93ddd292cf106fe7ef147151a51fd5aa2b1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Leander Beernaert 2020-02-05 17:35:49 +01:00
parent a43f2a6caa
commit 2c297ac598
2 changed files with 14 additions and 0 deletions

View File

@ -1870,6 +1870,14 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
"${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake"
INSTALL_DESTINATION "${config_install_dir}"
)
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}BuildInternals.cmake")
configure_file("${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}BuildInternals.cmake"
"${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}BuildInternals.cmake"
@ONLY)
list(APPEND extra_cmake_files "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}BuildInternals.cmake")
endif()
write_basic_package_version_file(
"${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake"
VERSION ${PROJECT_VERSION}

View File

@ -66,3 +66,9 @@ if (@QT_MODULE_HAS_META_TYPES_FILE@)
endif()
endif()
endif()
# Load Module's BuildIntenals should any exist
if (@INSTALL_CMAKE_NAMESPACE@BuildInternals_DIR AND
EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@BuildInternals.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@BuildInternals.cmake")
endif()