[CMake] CMake generated build number?

Bill Hoffman bill.hoffman at kitware.com
Wed Nov 5 11:39:04 EST 2008

Blezek, Daniel J. wrote:
> Bill,
>   This is great and it works.  I have several sub-projects in our main
> source code, but I can't seem to share the ADD_CUSTOM_COMMAND amongst
> them.  Is there some way to do this once for all projects?

You might want to create a custom target that your other targets depend 
on.  There is not a way to shared the add_custom_command.  You could 
create a macro or a function that adds the custom command.  I would 
think that you would want to create some version.cxx file that gets 
built into a library, and not repeat that in every project...


More information about the CMake mailing list