mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-09 18:09:02 -05:00
The semantics of the `GENERATED` property do not depend on the kind of target to which the sources are attached. Convert the tests to use custom targets instead of executables so that we do not have to enable the CXX language and initialize support of its toolchain for every case. This significantly reduces the time the test takes to run.
13 lines
336 B
CMake
13 lines
336 B
CMake
add_custom_target(custom)
|
|
target_sources(custom PRIVATE
|
|
"${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
|
|
)
|
|
|
|
set_property(SOURCE
|
|
"${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
|
|
PROPERTY GENERATED "1")
|
|
get_property(prop SOURCE
|
|
"${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
|
|
PROPERTY GENERATED)
|
|
message(NOTICE "prop: `${prop}`")
|