[CMake] Ignoring system paths for dependency checking

Brad King brad.king at kitware.com
Mon Dec 12 09:33:58 EST 2005


Gregor Berginc wrote:
>>Look at the INCLUDE_REGULAR_EXPRESSION command.
> 
> 
> I found this command few days after my post but I was unable to
> prepare regular expressions that would rule out the includes from
> /usr/... directories

The command is used to match files inside #include lines BEFORE trying 
to locate them.  The idea is that projects should have a prefix on all 
their includes and then setup the regex to match it.  Most projects 
either do this:

#include "myprojFoo.h"

or this:

#include <myproj/Foo.h>

In either case it is easy to create a regex.  This is an old feature 
inherited from CMake's earliest days as a build tool for a specific 
project that used this convention.

Really we should setup a way to just scan files that are found within a 
certain set of paths (like the project source and build trees).  You can 
submit a feature request here:

http://www.cmake.org/Bug

-Brad


More information about the CMake mailing list