911cc9a39e
These policies should be checked at the call site that tries to access the LOCATION or SOURCES property, not the directory scope containing the target. Thread the caller context through cmTarget::GetProperty to use for checking the policy setting and emitting a diagnostic with proper backtrace. Extend the RunCMake.CMP0026 and RunCMake.CMP0051 tests with cross-directory cases.
15 lines
280 B
CMake
15 lines
280 B
CMake
|
|
add_library(objects OBJECT empty.cpp)
|
|
|
|
add_library(empty empty.cpp $<TARGET_OBJECTS:objects>)
|
|
|
|
get_target_property(srcs empty SOURCES)
|
|
|
|
message("Sources: \"${srcs}\"")
|
|
|
|
add_subdirectory(CMP0051-WARN-Dir)
|
|
|
|
get_target_property(srcs empty2 SOURCES)
|
|
|
|
message("Sources: \"${srcs}\"")
|