Add generator expression `$<DEBUG_CONFIG>` which respects `DEBUG_CONFIGURATIONS` variable
Currently it is possible to check if a configuration is a debug configuration with the Boolean generator expression $<CONFIG:Debug>
. However, some people define their own build configurations with custom names (e.g. "Deb"/"Rel"). The DEBUG_CONFIGURATIONS variable can be used to tell CMake which configurations are considered debug configurations for purposes of linking.
Perhaps we could add a generator expression which checks if the current build configuration is in DEBUG_CONFIGURATIONS
if set? I guess it would be the equivalent of
$<OR:
$<AND:
$<CONFIG:Debug>,
$<NOT:
$<BOOL:${DEBUG_CONFIGURATIONS}>
>
>,
$<IN_LIST:$<CONFIG>,${DEBUG_CONFIGURATIONS}>
>
(with line breaks inserted for better readability)
Having such a generator expression would also simplify the cmTarget::GetDebugGeneratorExpressions()
function.
Or perhaps the new generator expression should simply be called $<DEBUG>
, and maybe accompanied by an expression $<OPTIMIZED>
defined as its Boolean negation for symmetry with the debug
and optimized
keywords in target_link_libraries()
?