diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-12-26 13:11:23 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-01-04 10:28:57 (GMT) |
commit | 272a20f8e554d7c4136119f252f163bcfc64dac0 (patch) | |
tree | 91e65cdd375642ed4083bcfa5aa87f2eeba97ac1 /Source/cmTarget.cxx | |
parent | 03d842a982267f75cf77810de2c693c36e58574c (diff) | |
download | CMake-272a20f8e554d7c4136119f252f163bcfc64dac0.zip CMake-272a20f8e554d7c4136119f252f163bcfc64dac0.tar.gz CMake-272a20f8e554d7c4136119f252f163bcfc64dac0.tar.bz2 |
cmTarget: Don't update IMPORTED target compilation properties
The include_directories() and add_compile_options() commands
should not append to the corresponding target property for IMPORTED
targets. This is already the case for add_definitions().
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b3ad798..6019496 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -330,34 +330,36 @@ void cmTarget::SetMakefile(cmMakefile* mf) // Save the backtrace of target construction. this->Makefile->GetBacktrace(this->Internal->Backtrace); - // Initialize the INCLUDE_DIRECTORIES property based on the current value - // of the same directory property: - const std::vector<cmValueWithOrigin> parentIncludes = - this->Makefile->GetIncludeDirectoriesEntries(); - - for (std::vector<cmValueWithOrigin>::const_iterator it - = parentIncludes.begin(); it != parentIncludes.end(); ++it) + if (!this->IsImported()) { - this->InsertInclude(*it); - } + // Initialize the INCLUDE_DIRECTORIES property based on the current value + // of the same directory property: + const std::vector<cmValueWithOrigin> parentIncludes = + this->Makefile->GetIncludeDirectoriesEntries(); - const std::set<cmStdString> parentSystemIncludes = - this->Makefile->GetSystemIncludeDirectories(); + for (std::vector<cmValueWithOrigin>::const_iterator it + = parentIncludes.begin(); it != parentIncludes.end(); ++it) + { + this->InsertInclude(*it); + } + const std::set<cmStdString> parentSystemIncludes = + this->Makefile->GetSystemIncludeDirectories(); - for (std::set<cmStdString>::const_iterator it - = parentSystemIncludes.begin(); - it != parentSystemIncludes.end(); ++it) - { - this->SystemIncludeDirectories.insert(*it); - } + for (std::set<cmStdString>::const_iterator it + = parentSystemIncludes.begin(); + it != parentSystemIncludes.end(); ++it) + { + this->SystemIncludeDirectories.insert(*it); + } - const std::vector<cmValueWithOrigin> parentOptions = - this->Makefile->GetCompileOptionsEntries(); + const std::vector<cmValueWithOrigin> parentOptions = + this->Makefile->GetCompileOptionsEntries(); - for (std::vector<cmValueWithOrigin>::const_iterator it - = parentOptions.begin(); it != parentOptions.end(); ++it) - { - this->InsertCompileOption(*it); + for (std::vector<cmValueWithOrigin>::const_iterator it + = parentOptions.begin(); it != parentOptions.end(); ++it) + { + this->InsertCompileOption(*it); + } } if (this->GetType() != INTERFACE_LIBRARY) |