diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2016-12-01 17:15:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-12-07 13:24:00 (GMT) |
commit | 8f47a5f16aa685e15e6b49c0b90a58b18ea38d0a (patch) | |
tree | a8476a57b461bc1b74b89bf09dd9417ac0c6162c | |
parent | 057ac11bfbc5501c8037b173a73a55466163774d (diff) | |
download | CMake-8f47a5f16aa685e15e6b49c0b90a58b18ea38d0a.zip CMake-8f47a5f16aa685e15e6b49c0b90a58b18ea38d0a.tar.gz CMake-8f47a5f16aa685e15e6b49c0b90a58b18ea38d0a.tar.bz2 |
cmGeneratorTarget: Add AddIncludeDirectory method (experimental)
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 15 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 6 |
2 files changed, 21 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 903bcec..6ee2c14 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -533,6 +533,21 @@ void cmGeneratorTarget::AddTracedSources(std::vector<std::string> const& srcs) } } +void cmGeneratorTarget::AddIncludeDirectory(const std::string& src, + bool before) +{ + this->Target->InsertInclude(src, this->Makefile->GetBacktrace(), before); + cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); + cmGeneratorExpression ge(lfbt); + CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(src); + cge->SetEvaluateForBuildsystem(true); + // Insert before begin/end + std::vector<TargetPropertyEntry*>::iterator pos = before + ? this->IncludeDirectoriesEntries.begin() + : this->IncludeDirectoriesEntries.end(); + this->IncludeDirectoriesEntries.insert(pos, new TargetPropertyEntry(cge)); +} + std::vector<cmSourceFile*> const* cmGeneratorTarget::GetSourceDepends( cmSourceFile const* sf) const { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 4c3c14b..f568699 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -396,6 +396,12 @@ public: void AddTracedSources(std::vector<std::string> const& srcs); /** + * Adds an entry to the INCLUDE_DIRECTORIES list. + * If before is true the entry is pushed at the front. + */ + void AddIncludeDirectory(const std::string& src, bool before = false); + + /** * Flags for a given source file as used in this target. Typically assigned * via SET_TARGET_PROPERTIES when the property is a list of source files. */ |