diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2015-08-09 20:24:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-08-11 12:53:00 (GMT) |
commit | 5790aca4adfc21e9e042e93fa0dd290aab91be5c (patch) | |
tree | 96a242e06972a3d449534f17d3f8b56f85c76183 /Source/cmTargetIncludeDirectoriesCommand.cxx | |
parent | 422d3f68de6bfa5c3fad68d2b030f2a618a821a2 (diff) | |
download | CMake-5790aca4adfc21e9e042e93fa0dd290aab91be5c.zip CMake-5790aca4adfc21e9e042e93fa0dd290aab91be5c.tar.gz CMake-5790aca4adfc21e9e042e93fa0dd290aab91be5c.tar.bz2 |
target_include_directories: Support relative SYSTEM include dirs (#15464)
Diffstat (limited to 'Source/cmTargetIncludeDirectoriesCommand.cxx')
-rw-r--r-- | Source/cmTargetIncludeDirectoriesCommand.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx index 7824c89..7dfe9ca 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.cxx +++ b/Source/cmTargetIncludeDirectoriesCommand.cxx @@ -75,7 +75,23 @@ bool cmTargetIncludeDirectoriesCommand tgt->InsertInclude(this->Join(content), lfbt, prepend); if (system) { - tgt->AddSystemIncludeDirectories(content); + std::string prefix = + this->Makefile->GetCurrentSourceDirectory() + std::string("/"); + std::set<std::string> sdirs; + for (std::vector<std::string>::const_iterator it = content.begin(); + it != content.end(); ++it) + { + if (cmSystemTools::FileIsFullPath(it->c_str()) + || cmGeneratorExpression::Find(*it) == 0) + { + sdirs.insert(*it); + } + else + { + sdirs.insert(prefix + *it); + } + } + tgt->AddSystemIncludeDirectories(sdirs); } return true; } @@ -91,7 +107,7 @@ void cmTargetIncludeDirectoriesCommand if (system) { - std::string joined = cmJoin(content, ";"); + std::string joined = this->Join(content); tgt->AppendProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES", joined.c_str()); } |