[CMake] CMAKE_INCLUDE_CURRENT_DIR?

Pascal Fleury fleury at users.sourceforge.net
Fri Mar 16 14:31:03 EST 2007


On Friday 16 March 2007 17:56:46 Brandon J. Van Every wrote:
> Kishore, Jonnalagadda (IE10) wrote:
> >  But then, despite setting the value I had to put in
> > INCLUDE_DIRECTORIES(.)
>
> And I was brief because I don't know if there any caveats on how it can
> be used.  Maybe you found a bug.  Maybe the behavior isn't consistent
> across generators.  Maybe the value isn't propagated to subdirectories.

Hi,
My understanding of your sample is consistent with my reading of the doc and 
experience in my own builds: it includes the *current* dir, that is '.' with 
respect to the CMakeList.txt file it is currently processing. So 
CMAKE_INCLUDE_CURRENT_DIR indicates an additional automatic include for each 
CMakeList.txt file it processes. It makes it kind of dynamic, as it has a 
different absolute path to include for each CMakeList.txt file. 

So that in your src/CMakeList.txt it will actually include 'src/.' , as would 
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}),
 but not your root dir './'. The CMAKE_INCLUDE_CURRENT_DIR is a mark for 
future behavior, where as INCLUDE_DIRECTORIES is an action to take 
immediately.

Hopefully my explanation is clear enough. If somebody can express this more 
clearly, it should be put into wiki/docs.

--paf
-- 
--paf


More information about the CMake mailing list