From f30e1e3eeb9548cf38ae253619d9e89e5ace476b Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Tue, 4 Feb 2025 18:08:34 +0100 Subject: [PATCH] Forward other `qt_feature` options in `qt_feature_alias` Pick-to: 6.8 Change-Id: Ic0b7479e071fc17020a04ea48386054f0bbf3151 Reviewed-by: Alexandru Croitor (cherry picked from commit beda9c82492a0818299c1623cadd5a1be53ae897) --- cmake/QtFeature.cmake | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 1880819a6e0..d460d65275d 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -126,12 +126,14 @@ endfunction() # # TODO: See how to move this into the main `qt_feature` definition flow. # TODO: How to add `CONDITION` and how does it interact with the main feature's `EMIT_IF` -# TODO: Include or forward other options: LABEL, SECTION # # Synopsis # # qt_feature_alias( # ALIAS_OF +# [LABEL ] +# [PURPOSE ] +# [SECTION ] # [NEGATE] # ) # @@ -145,11 +147,19 @@ endfunction() # # `NEGATE` # Populate the main FEATURE variable with the opposite of the alias's value +# +# `LABEL`, `PURPOSE`, `SECTION` +# Same as in `qt_feature` function(qt_feature_alias alias_feature) set(option_args NEGATE ) - set(single_args ALIAS_OF) + set(single_args + ALIAS_OF + LABEL + PURPOSE + SECTION + ) set(multi_args "") cmake_parse_arguments(PARSE_ARGV 1 arg "${option_args}" "${single_args}" "${multi_args}") @@ -174,6 +184,15 @@ function(qt_feature_alias alias_feature) if(arg_NEGATE) list(APPEND forward_args ALIAS_NEGATE) endif() + if(arg_LABEL) + list(APPEND forward_args LABEL "${arg_LABEL}") + endif() + if(arg_PURPOSE) + list(APPEND forward_args PURPOSE "${arg_PURPOSE}") + endif() + if(arg_SECTION) + list(APPEND forward_args SECTION "${arg_SECTION}") + endif() set(_QT_FEATURE_DEFINITION_${alias_feature} ${forward_args} PARENT_SCOPE) set(_QT_FEATURE_ALIASES_${arg_ALIAS_OF} "${_QT_FEATURE_ALIASES_${arg_ALIAS_OF}}" PARENT_SCOPE)