mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-29 02:19:18 -05:00
8ac826a5f2
The historic implementation of `$<CONFIG>` had some errors that could result in multiple configurations matching. First, it always considered the configuration of the consuming target, even if a consumed imported target selected a different configuration. Second, it matched the entire list of `MAP_IMPORTED_CONFIG_<CONFIG>` configurations, even if none of those were actually selected. The latter in particular is redundant at best, as we also consider the selected configuration of an imported target, which is the correct configuration to match for imported targets. Refactor the implementation so that only one configuration is considered. Fixes: #23660 Issue: #27022
12 lines
304 B
CMake
12 lines
304 B
CMake
project(test-CMP0199-WARN C)
|
|
|
|
set(CMAKE_POLICY_WARNING_CMP0199 ON)
|
|
|
|
add_library(lib_test INTERFACE IMPORTED)
|
|
set_target_properties(lib_test PROPERTIES
|
|
INTERFACE_COMPILE_DEFINITIONS "$<$<CONFIG:release>:RELEASE>"
|
|
)
|
|
|
|
add_executable(exe_test configtest.c)
|
|
target_link_libraries(exe_test PRIVATE lib_test)
|