Forward other qt_feature options in qt_feature_alias

Pick-to: 6.8
Change-Id: Ic0b7479e071fc17020a04ea48386054f0bbf3151
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit beda9c82492a0818299c1623cadd5a1be53ae897)
This commit is contained in:
Cristian Le 2025-02-04 18:08:34 +01:00
parent 1583078e45
commit f30e1e3eeb

View File

@ -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_feature>
# ALIAS_OF <real_feature>
# [LABEL <string>]
# [PURPOSE <string>]
# [SECTION <string>]
# [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)