mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
The output file structures of file(GENERATE) have to be created early to
be able to use the generated files in source lists.
This was not done correctly for subdirectories which has been fixed
in commit aee2c51224 (file(GENERATE): Create output file structures for
all directories first, 2020-09-10).
Add a test case to address issue #21144.
9 lines
253 B
CMake
9 lines
253 B
CMake
add_library(ObjLib OBJECT)
|
|
|
|
target_sources(ObjLib PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/ObjLib.cpp")
|
|
|
|
# Ensure re-generation
|
|
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/ObjLib.cpp")
|
|
|
|
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ObjLib.cpp" CONTENT "")
|