mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Now that set_property and set_target_properties support ALIAS targets, we need to extend support to all the target_* type commands that modify target properties. Relaxes target_compile_definitions, target_compile_features, target_compile_options, target_include_directories, target_link_directories, target_link_libraries, target_link_options, target_precompile_headers, and target_sources to now accept ALIAS targets. These commands set properties on the target which the alias references.
13 lines
526 B
CMake
13 lines
526 B
CMake
|
|
enable_language(CXX)
|
|
|
|
add_library(foo empty.cpp)
|
|
|
|
add_library(alias ALIAS foo)
|
|
|
|
target_include_directories(alias PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
|
get_target_property(val foo INCLUDE_DIRECTORIES)
|
|
if(NOT "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>" STREQUAL "${val}")
|
|
message(SEND_ERROR "target_include_directories(): Target property 'INCLUDE_DIRECTORIES' set on ALIAS 'alias' has wrong value on aliased target 'foo': '${val}' instead of '$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>'.")
|
|
endif()
|