[CMake] order of include dirs
Alexander Neundorf
a.neundorf-work at gmx.net
Wed Mar 29 15:59:05 EST 2006
> Von: Brad King <brad.king at kitware.com>
>
> Alexander Neundorf wrote:
> > in KDE we have the problem that e.g. when compiling kdebase the
> > headers
> > in the source dir should be preferred over the installed ones.
> > Usually we would do
> > include_directories( ${KDE4_INCLUDES} ) in the toplevel
> > CMakeLists.txt.
> > When adding more include dirs in CMakeLists.txt in deeper
> > directories, these directories will be appended to the list of
> > include dirs, except when used with the BEFORE keyword.
> > But now we cannot realistically expect that every KDE developer will
> > always remember the BEFORE keyword.
> > So we had two ideas:
> > make the behaviour configurable:
> > # make prepend default:
> > set(CMAKE_INCLUDE_DIRS_APPEND false)
> > # to force appending:
> > include_directories(AFTER dir1 dir2)
> >
> > Problem here: moving cmake files around to another project where this
> > isn't set would change the behaviour.
> >
> > Second idea:
> >
> > include_directories(LAST dir1 dir2)
> >
> > which would have the effect that the listed directories would always
> > be used after all other include dirs specified without the "LAST"
> > keyword.
>
> I think that will create two ordered lists of include directories
> instead of one, which will just be confusing.
What about the first idea ?
I think this would fit good to the include_directories() command.
Bye
Alex
--
Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer!
Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer
More information about the CMake
mailing list