From b3f2299e0600f3488aaeb78ebf66d1108201ea17 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 09:41:06 +0200 Subject: cmState: Move ProjectName from cmMakefile. --- Source/cmMakefile.cxx | 6 +++--- Source/cmMakefile.h | 2 -- Source/cmState.cxx | 12 ++++++++++++ Source/cmState.h | 3 +++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index abdd767..dbf41cc 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1525,7 +1525,7 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent) parent->GetProperty("LINK_DIRECTORIES")); // the initial project name - this->ProjectName = parent->ProjectName; + this->SetProjectName(parent->GetProjectName()); // Copy include regular expressions. this->ComplainFileRegularExpression = parent->ComplainFileRegularExpression; @@ -2046,12 +2046,12 @@ void cmMakefile::RemoveCacheDefinition(const std::string& name) void cmMakefile::SetProjectName(std::string const& p) { - this->ProjectName = p; + this->StateSnapshot.SetProjectName(p); } std::string cmMakefile::GetProjectName() const { - return this->ProjectName.c_str(); + return this->StateSnapshot.GetProjectName(); } void cmMakefile::AddGlobalLinkInformation(const std::string& name, diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index dfd3e19..81bb510 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -810,8 +810,6 @@ protected: mutable std::set CMP0054ReportedIds; - std::string ProjectName; // project name - // libraries, classes, and executables mutable cmTargets Targets; #if defined(CMAKE_BUILD_WITH_CMAKE) diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 53fdae0..6cd58b6 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -75,6 +75,8 @@ struct cmState::BuildsystemDirectoryStateType std::vector CompileOptions; std::vector CompileOptionsBacktraces; + std::string ProjectName; + cmPropertyMap Properties; }; @@ -1312,6 +1314,16 @@ cmState::Directory cmState::Snapshot::GetDirectory() const return Directory(this->Position->BuildSystemDirectory, *this); } +void cmState::Snapshot::SetProjectName(const std::string& name) +{ + this->Position->BuildSystemDirectory->ProjectName = name; +} + +std::string cmState::Snapshot::GetProjectName() const +{ + return this->Position->BuildSystemDirectory->ProjectName; +} + cmState::Directory::Directory( cmLinkedTree::iterator iter, const cmState::Snapshot& snapshot) diff --git a/Source/cmState.h b/Source/cmState.h index e503cd2..c3ff4e8 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -86,6 +86,9 @@ public: Directory GetDirectory() const; + void SetProjectName(std::string const& name); + std::string GetProjectName() const; + struct StrictWeakOrder { bool operator()(const cmState::Snapshot& lhs, -- cgit v0.12