file(GENERATE OUTPUT some_name INPUT some_name.tmp) deletes the input file
When using file(GENERATE OUTPUT ...cmake INPUT ...cmake.tmp)
, CMake deletes the input file after the generation step.
- This behaviour is surprising and undocumented.
- If the input file is created via
configure_file()
, CMake is re-run on every build due to the missing dependency ("Re-run cmake, missing byproduct: ...cmake.tmp"). This is how I found this issue: make install after make triggered an unexpected re-run of CMake.
The issue does not occur when the input file does not end in ...cmake.tmp
.