Files
cmake/Tests/RunCMake/GeneratorExpression/Empty-IMPORTED_CONFIGURATIONS.cmake
Matthew Woehlke 23f1cb47c7 cmTarget: Don't crash on empty IMPORTED_CONFIGURATIONS
The logic to select an imported configuration handled the case when
`IMPORTED_CONFIGURATIONS` was missing, but assumed that if it was
present, it was non-empty, which could cause CMake to crash if that
happens. (To be fair, I believe this would never happen for imports
generated by CMake.) Adjust the logic slightly to follow the same code
path when `IMPORTED_CONFIGURATIONS` is empty as is taken if it's
missing.

Fixes: #28065
2026-09-02 13:36:50 -04:00

8 lines
250 B
CMake

cmake_minimum_required(VERSION 4.4)
project(empty_imported_configuration NONE)
add_library(imported UNKNOWN IMPORTED)
set_property(TARGET imported PROPERTY IMPORTED_CONFIGURATIONS "")
file(GENERATE OUTPUT out.txt CONTENT "$<TARGET_FILE:imported>")