[CMake] Adding files to a Custom target

Dieter Rosch dieter at bbd.co.za
Thu Apr 24 16:26:25 EDT 2008


Hi,

 

Is there a way to add files to a custom target? This may sound a little
silly, but I do have a valid reason for it J

 

We have a custom target called "codegen". What we've done, is to add all the
output files from our code generators as dependencies of "codegen". We then
make any project that requires any of the generated files, dependant on
"codegen". In this manner, we ensure that generation happens when needed.
(Incidentally, is there a more elegant way of doing this, or is that the
correct approach?)

 

In any case, we have a number of generators, each of which has its own set
of input data. We have these input files split into multiple .txt files (one
per generator), which are INCLUDED() into the CMakeLists.txt.

 

The problem is, in Visual Studio, you typically want these .txt files to
show up under the "codegen" project, so that editing them is quick and easy.
The only way I know of, is to add them as source files to the custom target.
Problem is that I don't know of a way to do this for custom targets.  

 

Is there a way? Otherwise, is this a feature that the CMake team might look
at implementing in the future?

 

Regards,

Dieter Rosch

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080424/e6dd0725/attachment.htm>


More information about the CMake mailing list