mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-30 10:20:56 -06:00
Previously the command considered non-absolute source file paths relative to the associated target on the LHS. This causes problems in incremental builds where files are added from subdirectories and forces users to workaround by manually converting to absolute paths. Change this to enable more intuitive usage by projects. Fixes #17981
12 lines
285 B
CMake
12 lines
285 B
CMake
cmake_policy(SET CMP0076 NEW)
|
|
|
|
add_library(iface INTERFACE)
|
|
|
|
add_subdirectory(RelativePathInSubdirInterface)
|
|
|
|
get_property(iface_sources TARGET iface PROPERTY INTERFACE_SOURCES)
|
|
message(STATUS "iface: ${iface_sources}")
|
|
|
|
add_executable(main main.cpp)
|
|
target_link_libraries(main iface)
|