mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Currently, getting properties from an ALIAS target retrieves the property from the target which the alias references while setting properties results in an error. This relaxes set_property and set_target_properties to accept ALIAS targets and act on the referenced target, mirroring the get behavior. An error is raised when setting ALIAS_GLOBAL or ALIASED_TARGET on an ALIAS target. Closes: #19445
14 lines
367 B
CMake
14 lines
367 B
CMake
|
|
enable_language(CXX)
|
|
|
|
add_library(foo empty.cpp)
|
|
|
|
add_library(alias ALIAS foo)
|
|
|
|
set_target_properties(alias PROPERTIES ANYTHING 1)
|
|
|
|
get_target_property(val foo ANYTHING)
|
|
if(NOT val STREQUAL "1")
|
|
message(SEND_ERROR "set_target_properties(): Target property 'ANYTHING' set on ALIAS 'alias' has wrong value on aliased target 'foo': '${val}' instead of '1'.")
|
|
endif()
|