Re: Custom Build Phase Woes
Re: Custom Build Phase Woes
- Subject: Re: Custom Build Phase Woes
- From: Rush Manbert <email@hidden>
- Date: Thu, 25 Aug 2005 10:35:49 -0700
Nobody bit on this one, so I'll try adding a touch of refinement to the
problem statement.
The files that are generated by the tool can be named anything. They are
only included into other files, so I could force them to have special
extensions. Maybe .toolname_h and .toolname_cpp for example. Does this
make it any easier to use one of the built in methods? (I suspect not,
but it's worth asking.)
The other alternative I can see is that I can write a Makefile that does
this, so that I don't regenerate code unless the relevant header file
changes, and run a make from a custom script build phase. That seems
sort of ironic...
- Rush
Rush Manbert wrote:
I would like to use a code generation tool to help me generate some
interface wrapper code. The basic model the tool uses is this:
* You define a C++ class, both the .h and the .cpp.
* In the .h, you add some markup text that the code generator recognizes.
* You process the class header file with the tool, which produces
additional header (.h) and implementation (.cpp) files.
* Inside your class header file, you include the generated header. (It
adds methods to your class)
* Inside your class implementation file, you include the generated
implementation file. (It implements the added methods)
So, in general, the layout is like this:
File MyClass.h:
class MyClass
{
MyClass ();
~MyClass ();
// Other stuff
protected:
#include "MyClassGeneratedHeader.h"
}:
// End File MyClass.h
File MyClass.cpp:
#include "MyClass.h"
#include "MyClassGeneratedImplementation.cpp"
MyClass::MyClass()
// etc.
// End File MyClass.cpp
What I would like to be able to do is just check in MyClass.h and
MyClass.cpp. I need to run the code generation tool against the header
in order to create the generated code files. I also need to detect
when the header file has changed and regenerate the code as required.
Note that the generated .cpp file does not get added to the project.
(It doesn't compile on its own.) (Although, come to think of it, it
only gets compiled because it's in the Compile Sources build phase by
default.)
I have read the documentation about custom build phases, and I have
tried using both a custom shell script phase and a custom rule in
conjunction with the Compile Sources phase, but neither worked. Can
someone point me to better documentation, or tell me how you solved
this sort of problem? I would be very grateful for some help.
TIA,
Rush
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden