• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Custom Build Phase Woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Custom Build Phase Woes


  • Subject: Custom Build Phase Woes
  • From: Rush Manbert <email@hidden>
  • Date: Tue, 23 Aug 2005 15:39:04 -0700

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


  • Follow-Ups:
    • Re: Custom Build Phase Woes
      • From: Rush Manbert <email@hidden>
  • Prev by Date: nib resources
  • Next by Date: Re: nib resources
  • Previous by thread: Re: nib resources
  • Next by thread: Re: Custom Build Phase Woes
  • Index(es):
    • Date
    • Thread