Files
CMake/Tests/RunCMake/CMP0026/CMP0026-OLD.cmake
T
Brad King 5e616fcf9a CMP0026: Fix OLD behavior with file written during configure step
Refactoring in commit 60307c5056 (cmGeneratorTarget: Replace source
classifier implementation, 2017-04-07) accidentally regressed support
for CMP0026's OLD behavior in the case of a source file written by
project code during the configure step after getting a LOCATION.  We
should not perform full source classification until the generate step
because files written by the project's configure step may not exist yet.

Add special logic to support this case.  Add a test case for it.

Reported-by: David Stoup <david.stoup@kitware.com>
2017-04-17 10:10:15 -04:00

13 lines
277 B
CMake

enable_language(CXX)
cmake_policy(SET CMP0026 OLD)
set(out ${CMAKE_CURRENT_BINARY_DIR}/out.txt)
add_library(somelib empty.cpp ${out})
get_target_property(_loc somelib LOCATION)
file(WRITE "${out}"
"source file written by project code after getting target LOCATION\n"
)