summaryrefslogtreecommitdiffstats
path: root/Tests/GeneratorExpression/CMakeLists.txt
diff options
context:
space:
mode:
authorLuis Caro Campos <3535649+jcar87@users.noreply.github.com>2022-12-15 14:58:43 (GMT)
committerBrad King <brad.king@kitware.com>2022-12-16 14:00:34 (GMT)
commite455265d72e42ccf47c27dc5068f664f9e84012d (patch)
tree8142d32c875ddce1dc9103af72e89829571410ca /Tests/GeneratorExpression/CMakeLists.txt
parentdcb1c9c080d9dc7231893baf8bd71713ed2fe021 (diff)
downloadCMake-e455265d72e42ccf47c27dc5068f664f9e84012d.zip
CMake-e455265d72e42ccf47c27dc5068f664f9e84012d.tar.gz
CMake-e455265d72e42ccf47c27dc5068f664f9e84012d.tar.bz2
Genex: Fix CONFIG on imported target with no explicit mapping
When evaluating the `$<CONFIG>` genex on an imported target has the `IMPORTED_CONFIGURATIONS` property set, the current project has a config that does not match any of those, and no explicit configuration mappings are defined, fall back to the same configuration as `IMPORTED_LOCATION`. Fixes: #24222
Diffstat (limited to 'Tests/GeneratorExpression/CMakeLists.txt')
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 6187966..3fb53d1 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -200,6 +200,12 @@ set_property(TARGET importedFallback PROPERTY IMPORTED_LOCATION fallback_loc)
set_property(TARGET importedFallback PROPERTY MAP_IMPORTED_CONFIG_DEBUG "" DEBUG)
set_property(TARGET importedFallback PROPERTY MAP_IMPORTED_CONFIG_RELEASE "")
+add_library(importedFallback_genex STATIC IMPORTED)
+set_property(TARGET importedFallback_genex PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+set_property(TARGET importedFallback_genex PROPERTY IMPORTED_LOCATION_RELEASE release_loc)
+set_property(TARGET importedFallback_genex PROPERTY
+ INTERFACE_COMPILE_DEFINITIONS $<$<CONFIG:Release>:FOOBAR=1>)
+
add_custom_target(check-part3 ALL
COMMAND ${msys2_no_conv} ${CMAKE_COMMAND}
-Dtest_version_greater_1=$<VERSION_GREATER:1.0,1.1.1>
@@ -211,6 +217,7 @@ add_custom_target(check-part3 ALL
-Dconfig=$<CONFIGURATION>
-Dtest_imported_includes=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES>
-Dtest_imported_fallback=$<STREQUAL:$<TARGET_FILE_NAME:importedFallback>,fallback_loc>
+ -Dtest_imported_fallback_genex=$<STREQUAL:$<TARGET_PROPERTY:importedFallback_genex,INTERFACE_COMPILE_DEFINITIONS>,FOOBAR=1>
-Dtest_alias_file_exe=$<STREQUAL:$<TARGET_FILE:Alias::SomeExe>,$<TARGET_FILE:someexe>>
-Dtest_alias_file_lib=$<STREQUAL:$<TARGET_FILE:Alias::SomeLib>,$<TARGET_FILE:empty1>>
-Dtest_alias_target_name=$<STREQUAL:$<TARGET_PROPERTY:Alias::SomeLib,NAME>,$<TARGET_PROPERTY:empty1,NAME>>