diff options
author | Patrick Stotko <stotko@cs.uni-bonn.de> | 2018-06-02 15:20:51 (GMT) |
---|---|---|
committer | Patrick Stotko <stotko@cs.uni-bonn.de> | 2018-06-18 19:01:57 (GMT) |
commit | 316815e1f4beb66b679f27f96800facef572889e (patch) | |
tree | 99c44018136c1fe6ead03b4c00359af72be1dc82 /Tests/RunCMake/TargetSources/CMP0076-OLD.cmake | |
parent | f31d4ac7d68a1939d22ab7246b51e0ac10842bec (diff) | |
download | CMake-316815e1f4beb66b679f27f96800facef572889e.zip CMake-316815e1f4beb66b679f27f96800facef572889e.tar.gz CMake-316815e1f4beb66b679f27f96800facef572889e.tar.bz2 |
target_sources: Interpret relative paths as relative to the calling directory
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
Diffstat (limited to 'Tests/RunCMake/TargetSources/CMP0076-OLD.cmake')
-rw-r--r-- | Tests/RunCMake/TargetSources/CMP0076-OLD.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/TargetSources/CMP0076-OLD.cmake b/Tests/RunCMake/TargetSources/CMP0076-OLD.cmake new file mode 100644 index 0000000..4d8c268 --- /dev/null +++ b/Tests/RunCMake/TargetSources/CMP0076-OLD.cmake @@ -0,0 +1,10 @@ +cmake_policy(SET CMP0076 OLD) + +add_library(iface INTERFACE) +target_sources(iface INTERFACE empty_1.cpp) + +get_property(iface_sources TARGET iface PROPERTY INTERFACE_SOURCES) +message(STATUS "iface: ${iface_sources}") + +add_executable(main main.cpp) +target_link_libraries(main iface) |