[CMake] CMAKE_CURRENT_SOURCE_DIR showing up in include directories

Robert Dailey rcdailey.lists at gmail.com
Thu Jun 7 21:14:54 EDT 2012


I think I might know what it is...

I do the following:

include_directories( Z )
add_library( A )
include_directories( A ) # Include "A"'s include directory
add_library(B) # B depends on A, and thus includes its header directory

My assumption was that, at configuration time, a snapshot of the current
include directories is taken and used, so thus any further ones that are
added will not affect previously created targets in the same directory.
However, apparently directory properties are processed at generation time,
so this is why I'm seeing this behavior.

Can anyone confirm?

On Thu, Jun 7, 2012 at 8:01 PM, Robert Dailey <rcdailey.lists at gmail.com>wrote:

> Also,  CMAKE_INCLUDE_CURRENT_DIR is not enabled. In addition, I do not
> see the current *binary* directory included in the list of include
> directories (which would appear if I had  CMAKE_INCLUDE_CURRENT_DIR
>  enabled)
>
>
> On Thu, Jun 7, 2012 at 7:56 PM, Robert Dailey <rcdailey.lists at gmail.com>wrote:
>
>> For some reason, I'm seeing CMAKE_CURRENT_SOURCE_DIR (its value) show up
>> in my list of include directories for some of the visual studio 2008
>> projects that CMake generates. I'm not explicitly including it in my call
>> to include_directories(), so I'm not sure what is doing it. I debug the
>> code that passes includes to include_directories() command, and that
>> directory is not in the list.
>>
>> Any ideas? Thanks in advance.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120607/364f82ae/attachment-0001.htm>


More information about the CMake mailing list