Summary
I would like to make a (boolean) property unset in CMake such that get_property(... SET) returns 0 although the property was set in the first place. Settings the property to 0, FALSE, or OFF is not sufficient. How to achieve that?
Background
I have some custom commands which generate some source files. CMake automatically assigns the GENERATED source file property to those. This seems to make the GNU Makefile generator to add a rule to remove these files with make clean.
However, I do not want those files to be cleaned up, because once they exist the user may edit them. The custom command should only make sure they become generated if they do not exist. Generating them at configure-time with execute_process instead of the custom command is not feasible.
Setting GENERATED to 0, FALSE, or OFF did not exclude the sources from clean.
Versions
- OS: Ubuntu 16.04
- CMake: 3.5.1 (from Ubuntu 16.04 repository)
I'm currently bound to Ubuntu 16.04 and getting all users to use a more recent CMake version should be avoided if possible.