Re: Source Tree Preference
Re: Source Tree Preference
- Subject: Re: Source Tree Preference
- From: Scott Tooker <email@hidden>
- Date: Mon, 10 Nov 2003 09:10:30 -0800
On Nov 10, 2003, at 8:47 AM, Benjohn wrote:
>
> On 8 Nov 2003, at 17:14, Scott Tooker wrote:
>
>> Just to clarify some things:
>>
>> 1. Xcode doesn't support recursive search paths.
>
> I'm (personally) not too bothered (so far, duno how it'll pan out
> though) about not having recursive search paths. Using Boost as an
> example, my includes would usually be of the style:
> #include <boost/shared_ptr.hpp>
> #include <boost/bind.hpp>
> #include <boost/numeric/ublas/blas.hpp>
> etc
>
Hmm, the only oddity here is that you are using <> instead of "". <>
indicates that the system (or framework) should be checked first. I
would expect that
#include "boost/bind.hpp"
would work just as well and be more accurate about what you want to do
(i.e. you don't want to look in the system headers or any frameworks
since this is loose "user" code).
>
>> 2. The 'Source Trees' support provides a way for users to define
>> custom root paths. For example, the CodeWarrior Importer defines a
>> source tree that points to the "Metrowerks CodeWarrior" folder on
>> your disk. This makes it possible to define a relative path to
>> PowerPlant files that works for multiple users. Of course, this
>> requires that each user define the same Source Tree name in their
>> preferences.
>
> Then source trees are an alias for a folder of source? Using an alias
> allows each developer to instal the folder at a location of their
> choosing.
>
> Right :)
A "Source Tree" is just a user-define path root. For example, here is
the source tree that Xcode adds when importing a CodeWarrior project:
Name: CodeWarrior
Display Name: CodeWarrior Folder
Path: /Volumes/Arkham/Metrowerks CodeWarrior 8.0/Metrowerks CodeWarrior
The key is that all user of a given project need to have this source
tree defined, but for each user the path (and display name,
potentially) may vary.
Note that the source tree is just used by Xcode when dealing with file
references in the project, it doesn't need to be mentioned at all in
your sources.
>
>> So the best thing to do in your case is create a source tree that
>> points to the root of the boost sources. Then add all the boost
>> sources (including the headers) to the project and use that source
>> trees for the reference style (instead of project relative, make it
>> point to your source tree).
>
> *snip*
>
>> At this point you'll probably need to add header search paths as
>> needed (though, since you've included all the headers you shouldn't
>> need many).
>
> Ok, so stuff that's part of the project, irrespective of where it is,
> can be included in the style:
>
> #include "thing_in_project.hpp"
>
> Because our source files include boost in the manner I described
> above, am I correct that this wont work? I would have to modify as
> follows:
> #include <boost/shared_ptr.hpp> -> #include "shared_ptr.hpp"
>
See above, but source trees don't affect #include statements in the
source at all. All that source trees do is provide a user-agnostic way
of referencing sources (that have been added to the project) that exist
outside the project folder, but not in a well-defined location like
/usr/include or a framework.
> As I don't want to make a change like that, I can instead add boost's
> root to the include path using an the info inspector for the project.
>
> However, I don't want to explicitly reference boost's local folder on
> my machine, do I? Presumably there is some syntax that makes use of
> the source tree name? Perhaps ...{BoostPath}... or ...$BoostPath... or
> something?
That's the idea, the you can reference the name of the source tree like
any build setting. So in my example above you could reference
$(CodeWarrior) to get the "CodeWarrior Folder" search tree path.
Scott
>
>
> Cheers,
> Benjohn
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.