[CMake] Generating C++ code from Idl language with variable number of files as output
Valentin-Daniel Boca
dboca at eservicios.indracompany.com
Mon Jul 18 08:42:10 EDT 2011
Hi everybody,
We have a very big project using rules written with Imake and we want to switch to Cmake.
Everything is more or less ok, except few things related to code generated.
We have some .idl files (Corba syntax) used to generate custom C++ wrappers in order to be able to have POD for shared memory, to serialize in/out, etc.
The problem with this is that every .idl file outputs a variable number of files.
xxx.idl:
---
#ifndef xxx_
#define xxx_
#include <xxx2.idl>
module xxx
{
struct Data
{
long r_long;
};
};
---
gen_code xxx.idl -> xxxIdl.h, xxxIdl.cc, xWrappers.h and xxxWData.h
So for every "keyword struct" there is one more file generated. The first three files are always the same.
Given this, I can't know the list of output files to put it in the list of add_custom_command output section.
I could add the first know thre files, but it's not always enough, because if there other *.cc from my project that includes one generated *.h cmake will not know how to make it (and there are).
I need somehow to be able to tell to add_custom_command that the content of OUTPUT files should be somehow taken from the result of running the COMMAND (which I know it's impossible).
Another issue is the dependencies of these .idl files.
They have a very similar syntax with C++, and they have at top something like "#include <xxx2.idl>" so in theory, touching one included *.idl should trigger the add_custom_command, but it doesn't.
I've tried the option IMPLICIT_DEPENDS with CXX as language but I don't get anything; even if this would work it's not ok, because this mean I would have to add manually all the tree of the included files, and this is not what I want.
I've searched the web, we have the 5th version of the book, we really don't know what to do about this.
Do you think there is any work around this problem ?
Thank you,
Daniel
________________________________
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Si no es vd. el destinatario indicado, queda notificado que la lectura, utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.
Evite imprimir este mensaje si no es estrictamente necesario.
This email and any file attached to it (when applicable) contain(s) confidential information that is exclusively addressed to its recipient(s). If you are not the indicated recipient, you are informed that reading, using, disseminating and/or copying it without authorisation is forbidden in accordance with the legislation in effect. If you have received this email by mistake, please immediately notify the sender of the situation by resending it to their email address.
Avoid printing this message if it is not absolutely necessary.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110718/1e9b25be/attachment-0001.htm>
More information about the CMake
mailing list