[CMake] CMAKE_INCLUDE_CURRENT_DIR?
Kishore, Jonnalagadda (IE10)
Kishore.Jonnalagadda at honeywell.com
Tue Mar 20 00:29:46 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,
If I understand you correctly, you mean to say that in the top level
CMakeLists.txt, if I SET(CMAKE_INCLUDE_CURRENT_DIR ON) and
INCLUDE_DIRECTORY(.) then all other subdirectories I add will all
automatically include the other directories?
This however, is not the behavior I am observing. Setting
CMAKE_INCLUDE_CURRENT_DIR does not seem to have any effect.
Warm regards,
Kishore
More information about the CMake
mailing list