[Cmake] Hiding Includes

Neil Killeen Neil . Killeen at atnf . csiro . au
Fri, 1 Aug 2003 12:28:48 +1000 (EST)


On Thu, 31 Jul 2003, Brad King wrote:

> > Is there any way I can tell CMake not to do this ?  I don't actually
> > know why CMake is including them (it could be from some included package
> > like itk or vtk i suppose).
>
> The only "automatic" include directory is supposed to be /usr/include,
> which is removed by CMake.  For some reason your platform is adding
> non-standard include locations automatically.  Right now there is no way
> to tell cmake to know add a -I for a specific path.  A work-around until
> we resolve this issue is to change all instances of /usr/local/include in
> your project's CMakeCache.txt file to /usr/include.  Then CMake will
> remove the -I for the directory, but the headers will still be found
> because the compiler automatically looks in /usr/local/include.
>
> -Brad
>

my system includes ITK, VTK and FLTK

On poking about a bit, I find these extra includes are appearing
when I include these packages.

For example, when I include FLTK, you get in CMakeCache.txt

INCLUDE_FLAGS = -I/DATA/ELARA_3/mitk/Source -I/usr/local/include

Now this has to be because FLTK is installed in

/usr/local/include/Fl

and in code, you put e.g.

#include <Fl/Fl_Check_Button.h>

to include FLTK headers.


WHen I include VTK only then I get

INCLUDE_FLAGS = -I/DATA/ELARA_3/mitk/Source -I/usr/local/include/vtk
-I/usr/local/gnu/include -I/usr/local/include

I have no idea why VTK is adding the gnu area.  But the inludes
are installed in /usr/local/vtk like FLTK

So it seems to me that fundamentally it is correct that the system
adds /usr/local/incude for FLTK and VTK etc.  The gnu one seems spurious.

The problem then is that the compiler is also implicitly adding these
locations, and then moaning becuase it is explcitly in the compile line
as well.

Now that I have a Dartboard running (yay me)  it is cluttered with all
these erroneous warnings.   I can't just edit the cache file becuase
the system is built from scrarch every day with a cron job (CMakeCache.txt
regenerated).


cheers
Neil