Files
cmake/Tests/RunCMake/alias_targets/add_dependencies.cmake
T
Arha Gatram 5f8cc64695 ALIAS: Add support for add_dependencies for ALIAS targets
The add_dependencies command currently accepts ALIAS targets for
<target-dependencies> which resolve to the referenced target. This further
relaxes the command to accept an ALIAS <target> where the command will
add the dependencies to the target which the alias references.
2026-07-08 11:51:51 -04:00

15 lines
359 B
CMake

enable_language(CXX)
add_library(foo empty.cpp)
add_library(bar empty.cpp)
add_library(alias ALIAS foo)
add_dependencies(alias bar)
get_property(DEPS TARGET foo PROPERTY MANUALLY_ADDED_DEPENDENCIES)
if(NOT DEPS STREQUAL "bar")
message(SEND_ERROR "add_dependencies(): Expected 'bar' as dependency of 'foo' but got: '${DEPS}' instead of 'bar'.")
endif()