[CMake] INCLUDE_DIRECTORIES in sub-directories doesn't work?

Bill Hoffman bill.hoffman at kitware.com
Wed Nov 26 15:41:44 EST 2008


Sean Soria wrote:
> Sorry, I got myself confused with COMPILE_DEFINITIONS.  It is
> INCLUDE_DIRECTORIES that I wanted.  Why is this a directory property
> if it can only be set for certain directories (those that contain
> targets or whose subdirectories contain targets)?
> 
The concept of a directory property in CMake is not one to one with the 
disk directories.   A directory in CMake is a directory that has a list 
of targets in it.  You can have a target that uses files from all sorts 
of different directories.   So, a directory property is not what you 
want.  What you really want is a source file property that allows 
setting include directories.  This is just not implemented yet.  For 
99.9% of the cases it does not matter if you get a few extra -I paths. 
However, this would be a nice to have feature.

http://public.kitware.com/Bug/view.php?id=1968&nbn=2


-Bill


More information about the CMake mailing list