From 4b09522c23e9efdf83ba8d4af436d8a700ccb66e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 6 May 2021 16:27:48 +0200 Subject: Add support for building and installing repo target sets Introduce the concept of repository target sets, which is a named set of targets within a Qt module repository. In a Qt repository, a repo target set 'qtfoo' can be defined in the top-level project file with qt_internal_define_repo_target_set(qtfoo DEPENDS Bar Baz) The DEPENDS argument specifies Qt components that need to be find_package'd when building the targets that belong to qtfoo. In subdirectory project files, use qt_internal_include_in_repo_target_set(qtfoo) to mark the file as belonging to the repo target set. To build and install a single repo target set, specify QT_BUILD_SINGLE_REPO_TARGET_SET=qtfoo when configuring the Qt repository. Change-Id: Ic9e6213e3225988fd561f315bc857ee44ff17420 Reviewed-by: Alexandru Croitor --- cmake/QtSingleRepoTargetSetBuildHelpers.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 cmake/QtSingleRepoTargetSetBuildHelpers.cmake (limited to 'cmake/QtSingleRepoTargetSetBuildHelpers.cmake') diff --git a/cmake/QtSingleRepoTargetSetBuildHelpers.cmake b/cmake/QtSingleRepoTargetSetBuildHelpers.cmake new file mode 100644 index 0000000000..789b23b6e6 --- /dev/null +++ b/cmake/QtSingleRepoTargetSetBuildHelpers.cmake @@ -0,0 +1,11 @@ +# Macro that checks for a single repo target set build, and returns from the current file, directory +# or function. Use this at the top of project files to whitelist the file for the given package. +macro(qt_internal_include_in_repo_target_set _repo_target_set_name) + if(DEFINED QT_BUILD_SINGLE_REPO_TARGET_SET) + if(NOT "${_repo_target_set_name}" STREQUAL QT_BUILD_SINGLE_REPO_TARGET_SET) + message(STATUS "Not part of repo target set ${QT_BUILD_SINGLE_REPO_TARGET_SET}: " + "${CMAKE_CURRENT_LIST_DIR}") + return() + endif() + endif() +endmacro() -- cgit v1.2.1