Re: including headers copied before compiling
Re: including headers copied before compiling
- Subject: Re: including headers copied before compiling
- From: "Kyle Sluder" <email@hidden>
- Date: Wed, 22 Aug 2007 10:47:06 -0400
You never really explain why you don't just use the proper path to
begin with. And if you're so dead-set on presenting your disjoint
collection of header files as one set, why not just define both the
libA/ and libB/ directories in your include path, that way you can
just #include <partA01.hh> without worrying about doing any copying
whatsoever?
Just keep in mind that putting a library's public header files and
source code in the same directory can be a sign that something hasn't
been thought all the way through. Logically, the library's interface
should be completely independent of the source.
--Kyle Sluder
On 8/22/07, Jason Addison <email@hidden> wrote:
> I'm trying to include headers that are not originally in their proper
> location relative to their implementation files. In my implementation
> files I have preprocessor lines like:
>
> #include <acme/partA01.hh>
>
> and the files are organized like:
>
> applic/
> libA/
> partA01.cc
> partA01.hh
> libB/
> partB01.cc
> partB01.hh // uses libA, also has #include <acme/partA01.hh>
> ...
>
> This is because
> 1) the headers got installed in a place like /usr/local/include/acme/
> 2) wanted headers in the same directory as their associacted c files
> 3) wanted lib files to include the headers in the same style as
> external lib users would
>
> I want to build libA as an embeded framework for the applic
> application. I also want libB as an embeded framework that is
> dependent on libA and includes some of libA's headers the same way
> external files would do.
>
> I was successful by adding a script to the libA framework target that
> copies the needed header files to an acme directory located in the
> same directory as the project file _before_ compiling. But this does
> not seem like the right thing to do; also, I worry that the build will
> always think the headers have changed and rebuild everything (this
> might not be true, I haven't really looked into it).
>
> I had first tried making symbolic links in the new acme directory
> instead of actually copying the headers, but that did not work ...
> does anyone know why it should not work?
>
> Next, after removing the script (and the headers it had copied in my
> acme directory), I tried making the headers public and having the
> build copy the headers to $(CONTENTS_FOLDER_PATH)/Headers/acme/. The
> headers got copied, but the build did not find them. So then I added
> that directory to the include search path and still no luck. This
> seems like the best solution so far except that the build may think
> all the headers change for each build ... and it does not work.
>
> What is the right way to make this work?
>
> If the right way is to conditionally use include statements that do
> not use the acme directory for __APPLE__, what is the next best right
> way?
>
> Thanks,
> Jason
> _______________________________________________
> 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