Brad King wrote: 
> Okay.  Since this is purely internal it can be factored into a generalized
> approach later.


Great. I mentioned this before:

> Note that the branch is work in progress. Currently the backtrace is not
> always initialized correctly when include_directories() is used. What do
> ya'll think of the idea?

The problem is that in this code:

 include_directories(foo/bar)
 add_library(the_lib ...)

the INCLUDE_DIRECTORIES target property is seeded by the directory property 
of the same name. The backtrace then leads to the add_library invokation 
instead of the include_directories invokation.

The fix is to modify the management of INCLUDE_DIRECTORIES in cmMakefile to 
be based on std::vector<cmMakefile::IncludeDirectoriesEntry>, where:

 struct IncludeDirectoriesEntry
 {
    std::string Value;
    cmListFileBacktrace Backtrace;
 };

and then use *that* backtrace (and some new API on cmTarget) in 
cmTarget::SetMakefile, instead of 

  this->SetProperty("INCLUDE_DIRECTORIES",
                    this->Makefile->GetProperty("INCLUDE_DIRECTORIES"));

Are you ok with that?

Thanks,

Steve.


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to