[cmake-developers] Printing the origin of include dirs

Brad King brad.king at kitware.com
Tue Dec 18 11:17:04 EST 2012


On 12/18/2012 11:02 AM, Stephen Kelly wrote:
> I didn't look into the implementation of it yet. By 'intern', you mean 
> storing const char * instead of std::string with the cmListFileBacktrace 
> object, and maintaining the strings elsewhere (globally?)?

Yes, something along these lines.

> Yes. Do you have any idea of what you'd like to see generalized? The 
> interception and struct for handling the INCLUDE_DIRECTORIES property 
> itself?

The cmPropertyMap/cmProperty infrastructure could potentially store
structures with the string values plus meta-data instead of just the
strings as now.  Then we would not need special cases for certain
properties in the C++ logic, just some kind of a boolean or enum of
possible behaviors that is kept with the property value or perhaps its
definition.

> Do you mean 
> 
>  set(CMAKE_DEBUG_TARGET_PROPERTIES INCLUDE_DIRECTORIES)
> 
> ?

Yes.

> That would be fine if the arg can be a list.
> 
>  set(CMAKE_DEBUG_TARGET_PROPERTIES 
>     "INCLUDE_DIRECTORIES;COMPILE_DEFINITIONS"
>  )
> 
> but then I don't think it's much better than:
> 
>  set(CMAKE_DEBUG_TARGET_INCLUDE_DIRECTORIES ON)
>  set(CMAKE_DEBUG_TARGET_COMPILE_DEFINITIONS ON)

The first one would generalize better and avoid special handling in
C++ for each property.

-Brad



More information about the cmake-developers mailing list