[CMake] add_custom_command - help - to specify a rule that can be used to convert all the .pc files to .cxx files

Thangaraj thangaraj.os at gmail.com
Fri May 14 01:02:20 EDT 2010


Hi All,

I am trying to replace the clearmake build system with cmake for one of my
corporate projects.
This is a C++ based project and the interaction to database is being done
using pro*C/C++ for which a meta compiler was provided by oracle.
We write the database interaction code in a .pc file, which will be compiled
by pro*C/C++ compiler (an executable named 'proc') to produce the regular
.cxx files.
The generated .cxx files can be compiled using the regular cxx compilers.

I have gone through the details of add_custom_command and found that it can
be used for the process which i have mentioned above.
But from the documentation, i see that the source file and target file name
should be explicitly specified.
What I am looking for is that, there should be a way by which using a single
'add_custom_command' i should be able to specify the rule for all my .pc
files in a folder.
In other words, i should be able to say my source files as '*.pc' and my
target file as 'sorcefile.cxx'.
Also i would like to have this rule in my master CMakeLists.txt, so that it
will be available in any sub directory.

Please let me know whether this is possible in cmake and if so, point me to
a simple example of doing it.
Appreciate your help on this.

Thanks,
-Thangaraj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100514/5b94c7cc/attachment.htm>


More information about the CMake mailing list