[CMake] order of include dirs

Alexander Neundorf a.neundorf-work at gmx.net
Mon Mar 27 15:19:08 EST 2006


Hi, 
 
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. 
 
What do you think ? 
 
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