/usr/include priority vs custom include paths

Mateusz Łoskot mateusz at loskot.net
Sat Oct 29 20:24:13 BST 2011


Hi,

I use two versions of Boost C++ libraries installed.
Boost 1.42 installed from .deb packages with headers in /usr/include.
Current Boost trunk with headers in my workshop folders inside $HOME.
Namely, in /home/mloskot/dev/boost/_svn/trunk.

I have configured "Custom include paths" this way:

http://www.flickr.com/photos/mloskot/6291933457/

My CMakeLists.txt however adds include directory from my Boost trunk location.

Now, I include header in my program:

#include <boost/spirit/include/qi.hpp>

and I noticed that KDevelop parser uses qi.hpp from /usr/include tree.
where Boost 1.42. is installed, but not from Boost trunk location.

Is there any way to make the custom include paths prioritised in such
way that the parser prefers user-defined locations first, then system locations?
It is /home/mloskot/dev/boost/_svn/trunk instead of /usr/include.

The parser reports searched include path a follows:

1. project directory, which is in my case /home/mloskot/workshop/boost
2. then /usr/include
3. custom include paths: /home/mloskot/dev/boost/_svn/trunk
4. other /usr/... includes

Here it is depicted:

http://www.flickr.com/photos/mloskot/6291988707/

So, it injects /usr/include between project and custom include paths.
This makes it impossible to prefer user-defined locations.

I have no knowledge about internals of the parser in KDevelop,
so I may be speculating too far, but would it be possible and sensible to look
for headers in locations ordered as follows:

1. project directory, which is in my case /home/mloskot/workshop/boost
2. custom include paths: /home/mloskot/dev/boost/_svn/trunk
3. then /usr/include
4. other /usr/... includes

This would be very helpful especially when working with different
branches of projects, where branches are located in different directories.
Then headers and code browsing information reported by KDevelop
matches actual source tree user works with.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org




More information about the KDevelop mailing list