• 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
Re: Code Index with "*.hh" Files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Code Index with "*.hh" Files


  • Subject: Re: Code Index with "*.hh" Files
  • From: "Colin A. Smith" <email@hidden>
  • Date: Sat, 01 Mar 2008 18:39:49 -0800
  • Thread-topic: Code Index with "*.hh" Files

> On Mar 1, 2008, at 4:15 PM, Colin A. Smith wrote:
>
>> Is it possible to configure Xcode to index *.hh files? If not, can
>> this
>> please be added to a release in the near future?

On 3/1/08 16:51, "Chris Espinosa" <email@hidden> wrote:

> Are your .hh files ever #included by a compiled file? Xcode doesn't
> index all files in the project comprehensively, it does a "rooted"
> walk from the source files .  In a native project this starts with all
> the sources in the Compile Source Files build phase and extends to the
> entire #include chain of all files referenced by those; in an External
> Build project Xcode might not even be able to tell what sources will
> be compiled at all (as the external makefile determines the file
> inclusion and dependencies).
>
> As a workaround, you could create a dummy target with one .cp file
> that #includes all your .hh files, and then they should appear in the
> project index.
>
> Chris

Thanks for the helpful comments. It turns out that the problem is not with
the file extension, but the fact that all of the headers are included using
<> instead of "". For instance:

#include <TestClass.hh>

The external build tool uses the -I flag to tell the compiler where to find
the header files. I thought that adding directories to the
HEADER_SEARCH_PATHS Xcode build setting might help the Code Sense indexer
find those header files. It doesn't appear that approach works. Is there
some other way to tell the indexer to search particular directories for
header files that are included using <> syntax?

I created a stripped down Xcode project that is configured similarly to my
project and exhibits all of the above behavior:

http://zinc.ucsf.edu/~colin/HeaderIndex.zip

The workaround of creating a *.cc file with #include "xxx.hh" lines did work
to a certain degree:

find ../src -name "*.hh" | sed -E 's/^(.+)$/#include "\1"/' > headers.cc

Unfortunately, using that approach, the included files popup doesn't allow
cross referencing with the *.cc files, which is a shame as that's one of the
more useful features, IMHO.

-Colin


 _______________________________________________
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: Code Index with "*.hh" Files
      • From: Philip Aker <email@hidden>
References: 
 >Re: Code Index with "*.hh" Files (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: In all UI fields, return enters new line (rather than clicking OK)
  • Next by Date: Can't follow instructions for the Hello example
  • Previous by thread: Re: Code Index with "*.hh" Files
  • Next by thread: Re: Code Index with "*.hh" Files
  • Index(es):
    • Date
    • Thread