summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-07-08 21:35:01 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-07-22 18:25:47 (GMT)
commitc7b39d06f9b1b5843682f52992634c8dad22aece (patch)
treed5ef225eb45637c58ad88be0a14697ceae227a35 /Source
parentb2de25adeda1c37c8d626432df25fce7cd2ab032 (diff)
downloadCMake-c7b39d06f9b1b5843682f52992634c8dad22aece.zip
CMake-c7b39d06f9b1b5843682f52992634c8dad22aece.tar.gz
CMake-c7b39d06f9b1b5843682f52992634c8dad22aece.tar.bz2
cmMakefile: Split accessors for include directories and origins.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx24
-rw-r--r--Source/cmMakefile.h3
-rw-r--r--Source/cmTarget.cxx27
-rw-r--r--Source/cmTarget.h3
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.cxx3
5 files changed, 31 insertions, 29 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8276faa..58d9d73 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -273,21 +273,18 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
}
}
-std::vector<cmValueWithOrigin> cmMakefile::GetIncludeDirectoriesEntries() const
+std::vector<std::string> cmMakefile::GetIncludeDirectoriesEntries() const
{
- std::vector<cmValueWithOrigin> entries;
- entries.reserve(this->IncludeDirectoriesEntries.size());
- std::vector<cmListFileBacktrace>::const_iterator btIt =
- this->IncludeDirectoriesEntryBacktraces.begin();
- for(std::vector<std::string>::const_iterator it =
- this->IncludeDirectoriesEntries.begin();
- it != this->IncludeDirectoriesEntries.end(); ++it, ++btIt)
- {
- entries.push_back(cmValueWithOrigin(*it, *btIt));
- }
- return entries;
+ return this->IncludeDirectoriesEntries;
}
+std::vector<cmListFileBacktrace>
+cmMakefile::GetIncludeDirectoriesBacktraces() const
+{
+ return this->IncludeDirectoriesEntryBacktraces;
+}
+
+
std::vector<std::string> cmMakefile::GetCompileOptionsEntries() const
{
return this->CompileOptionsEntries;
@@ -1942,7 +1939,6 @@ void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs,
cmListFileBacktrace lfbt = this->GetBacktrace();
std::string entryString = cmJoin(incs, ";");
- cmValueWithOrigin entry(entryString, lfbt);
this->IncludeDirectoriesEntries.insert(position, entryString);
this->IncludeDirectoriesEntryBacktraces.insert(btPos, lfbt);
@@ -1951,7 +1947,7 @@ void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs,
l != this->Targets.end(); ++l)
{
cmTarget &t = l->second;
- t.InsertInclude(entry, before);
+ t.InsertInclude(entryString, lfbt, before);
}
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 9b21608..8f236af 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -746,7 +746,8 @@ public:
/** Set whether or not to report a CMP0000 violation. */
void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; }
- std::vector<cmValueWithOrigin> GetIncludeDirectoriesEntries() const;
+ std::vector<std::string> GetIncludeDirectoriesEntries() const;
+ std::vector<cmListFileBacktrace> GetIncludeDirectoriesBacktraces() const;
std::vector<std::string> GetCompileOptionsEntries() const;
std::vector<cmListFileBacktrace> GetCompileOptionsBacktraces() const;
std::vector<std::string> GetCompileDefinitionsEntries() const;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0aa66cd..ac453e2 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -402,13 +402,18 @@ void cmTarget::SetMakefile(cmMakefile* mf)
{
// 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::vector<std::string> parentIncludes =
+ this->Makefile->GetIncludeDirectoriesEntries();
+ const std::vector<cmListFileBacktrace> parentIncludesBts =
+ this->Makefile->GetIncludeDirectoriesBacktraces();
- for (std::vector<cmValueWithOrigin>::const_iterator it
- = parentIncludes.begin(); it != parentIncludes.end(); ++it)
+ std::vector<cmListFileBacktrace>::const_iterator btIt =
+ parentIncludesBts.begin();
+ for (std::vector<std::string>::const_iterator it
+ = parentIncludes.begin();
+ it != parentIncludes.end(); ++it, ++btIt)
{
- this->InsertInclude(*it);
+ this->InsertInclude(*it, *btIt);
}
const std::set<std::string> parentSystemIncludes =
this->Makefile->GetSystemIncludeDirectories();
@@ -421,8 +426,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
const std::vector<cmListFileBacktrace> parentOptionsBts =
this->Makefile->GetCompileOptionsBacktraces();
- std::vector<cmListFileBacktrace>::const_iterator btIt =
- parentOptionsBts.begin();
+ btIt = parentOptionsBts.begin();
for (std::vector<std::string>::const_iterator it
= parentOptions.begin();
it != parentOptions.end(); ++it, ++btIt)
@@ -1931,17 +1935,18 @@ void cmTarget::AppendBuildInterfaceIncludes()
}
//----------------------------------------------------------------------------
-void cmTarget::InsertInclude(const cmValueWithOrigin &entry,
- bool before)
+void cmTarget::InsertInclude(std::string const& entry,
+ cmListFileBacktrace const& bt,
+ bool before)
{
- cmGeneratorExpression ge(entry.Backtrace);
+ cmGeneratorExpression ge(bt);
std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position
= before ? this->Internal->IncludeDirectoriesEntries.begin()
: this->Internal->IncludeDirectoriesEntries.end();
this->Internal->IncludeDirectoriesEntries.insert(position,
- new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry.Value)));
+ new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry)));
}
//----------------------------------------------------------------------------
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index ba3bc5a..f9bcb05 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -572,7 +572,8 @@ public:
std::vector<std::string> GetIncludeDirectories(
const std::string& config,
const std::string& language) const;
- void InsertInclude(const cmValueWithOrigin &entry,
+ void InsertInclude(std::string const& entry,
+ cmListFileBacktrace const& bt,
bool before = false);
void InsertCompileOption(std::string const& entry,
cmListFileBacktrace const& bt,
diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx
index 24500db..7824c89 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.cxx
+++ b/Source/cmTargetIncludeDirectoriesCommand.cxx
@@ -72,8 +72,7 @@ bool cmTargetIncludeDirectoriesCommand
bool prepend, bool system)
{
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- cmValueWithOrigin entry(this->Join(content), lfbt);
- tgt->InsertInclude(entry, prepend);
+ tgt->InsertInclude(this->Join(content), lfbt, prepend);
if (system)
{
tgt->AddSystemIncludeDirectories(content);