[CMake] Non existent / new file handling
Alexander Neundorf
a.neundorf-work at gmx.net
Fri Mar 13 13:39:44 EDT 2009
On Friday 13 March 2009, John Drescher wrote:
> Is there a way to have cmake automatically create empty missing source
> files instead of failing?
No, there is not.
> Basically I when I need to add new files I add new entries to my
> CMakeLists.txt file then I have to go to the shell and touch on each
> file I add so that cmake will not fail to regenerate the project.
Maybe you can write a macro which helps you with that. Like
MY_ADD_EXECUTABLE(), which takes the same arguments as the normal
ADD_EXECUTABLE(), but before handing them all over to ADD_EXECUTABLE(), check
if each file exists and if it doesn't, create it using FILE(WRITE ...).
But then you may get problems with files generated via ADD_CUSTOM_COMMAND().
I would not recommend this.
Alex
More information about the CMake
mailing list