[CMake] order of include dirs
Alexander Neundorf
a.neundorf-work at gmx.net
Fri Mar 31 01:43:07 EST 2006
> --- Ursprüngliche Nachricht ---
> Von: Brad King <brad.king at kitware.com>
> An: Alexander Neundorf <a.neundorf-work at gmx.net>
> Kopie: cmake at cmake.org
> Betreff: Re: [CMake] order of include dirs
> Datum: Thu, 30 Mar 2006 16:23:16 -0500
>
> Alexander Neundorf wrote:
> >>Von: Brad King <brad.king at kitware.com>
> >>Alexander Neundorf wrote:
> >>>What about the first idea ?
> >>>I think this would fit good to the include_directories() command.
> >>
> >>
> >>I think a magic switch that can easily be accidentally inherited by
> >>projects not expecting it will not work well.
> >
> > Maybe.
> > I think the order matters only if there is a file with the same name
in
> > several of the include directories.
> > In that case I'd even go so far to say that if foo.h exists in a
include
>
> > dir specified in the top level CMakeLists.txt, but also in a
directory
> > which was added explicitely somewhere deeper in the source tree using
> > INCLUDE_DIRECTORIES(), the intention was probably that this file
should
> > be prefered, since the include dir was specified more
"locally" (which
> > would equal always BEFORE by default).
>
> Yes, in hindsight it would clearly have been better to make BEFORE the
> default behavior. However, messing with include directory ordering now
> will potentially break many projects. This is why I'm waiting until
> include directories are optionally a target-specific property to change
> things. With the new interface it can be done "right". For now we
need
> to keep the old interface working the same way.
>
> The one-line macro I previously posted resolves the problem. Even if
> users don't use it they will only have a problem if they repeat KDE's
> header file names. When they do have a problem it won't take long to
> find the BEFORE fix.
Ok, last question.
How about just adding the keyword "AFTER" to the include command, which
would basically do nothing ?
Would it be possible to enforce a policy that when checking in to svn, if
a file named CMakeLists.txt contains a line which contains
"INCLUDE_DIRECTORIES", that this line also has to contain "AFTER" or
"BEFORE" ? AFAIK you do something like this in your cvs with tabs.
Otherwise we'll go with the macro (but for this case I wouldn't be overly
happy with it, because this is a very basic command and requiring a macro
for it wouldn't feel good IMO).
Bye
Alex
--
Analog-/ISDN-Nutzer sparen mit GMX SmartSurfer bis zu 70%!
Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer
More information about the CMake
mailing list