From 8f47a5f16aa685e15e6b49c0b90a58b18ea38d0a Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Thu, 1 Dec 2016 18:15:32 +0100 Subject: cmGeneratorTarget: Add AddIncludeDirectory method (experimental) --- Source/cmGeneratorTarget.cxx | 15 +++++++++++++++ Source/cmGeneratorTarget.h | 6 ++++++ 2 files changed, 21 insertions(+) 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 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 cge = ge.Parse(src); + cge->SetEvaluateForBuildsystem(true); + // Insert before begin/end + std::vector::iterator pos = before + ? this->IncludeDirectoriesEntries.begin() + : this->IncludeDirectoriesEntries.end(); + this->IncludeDirectoriesEntries.insert(pos, new TargetPropertyEntry(cge)); +} + std::vector 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 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. */ -- cgit v0.12