mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-21 13:48:33 -05:00
5e616fcf9a
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>
13 lines
277 B
CMake
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"
|
|
)
|