[Cmake-commits] CMake branch, next, updated. v3.3.1-2426-gbbc1c49
Stephen Kelly
steveire at gmail.com
Mon Aug 24 16:43:47 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via bbc1c4930d4220341cb40b885a8385b553a76962 (commit)
via b9a41481f81d86c22ad88379d72dd2eea62e96c2 (commit)
via 59a0a2d11440695747a570f960f42c84f1933b46 (commit)
via 660c297e03628a15c10fe9d3b325dabbdd6f3201 (commit)
via 5cb05849d91a178621011729d6c409f91cb011c6 (commit)
from 638e36e30d9430d2fe134d1a4c3903e37b589ff4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bbc1c4930d4220341cb40b885a8385b553a76962
commit bbc1c4930d4220341cb40b885a8385b553a76962
Merge: 638e36e b9a4148
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Aug 24 16:43:46 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Aug 24 16:43:46 2015 -0400
Merge topic 'cmState-ProjectName' into next
b9a41481 cmGlobalGenerator: Implement FillProjectMap in terms of cmState.
59a0a2d1 cmState: Move ProjectName from cmMakefile.
660c297e cmMakefile: Use std::string in ProjectName API.
5cb05849 cmMakefile: Out-of-line GetProjectName.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b9a41481f81d86c22ad88379d72dd2eea62e96c2
commit b9a41481f81d86c22ad88379d72dd2eea62e96c2
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Aug 2 09:41:11 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Aug 24 22:41:44 2015 +0200
cmGlobalGenerator: Implement FillProjectMap in terms of cmState.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 503c455..17bafbe 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2102,18 +2102,19 @@ void cmGlobalGenerator::FillProjectMap()
for(i = 0; i < this->LocalGenerators.size(); ++i)
{
// for each local generator add all projects
- cmLocalGenerator *lg = this->LocalGenerators[i];
+ cmState::Snapshot snp = this->LocalGenerators[i]->GetStateSnapshot();
std::string name;
do
{
- if (name != lg->GetMakefile()->GetProjectName())
+ std::string snpProjName = snp.GetProjectName();
+ if (name != snpProjName)
{
- name = lg->GetMakefile()->GetProjectName();
+ name = snpProjName;
this->ProjectMap[name].push_back(this->LocalGenerators[i]);
}
- lg = lg->GetParent();
+ snp = snp.GetBuildsystemDirectoryParent();
}
- while (lg);
+ while (snp.IsValid());
}
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59a0a2d11440695747a570f960f42c84f1933b46
commit 59a0a2d11440695747a570f960f42c84f1933b46
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Aug 2 09:41:06 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Aug 24 22:40:47 2015 +0200
cmState: Move ProjectName from cmMakefile.
It is necessary for now to always return the last set project name
for the directory, but that can be replaced with a snapshotted version
in the future.
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<cmListFileContext> 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..6c5370e 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -38,6 +38,8 @@ struct cmState::SnapshotDataType
std::vector<std::string>::size_type IncludeDirectoryPosition;
std::vector<std::string>::size_type CompileDefinitionsPosition;
std::vector<std::string>::size_type CompileOptionsPosition;
+
+ std::string ProjectName;
};
struct cmState::PolicyStackEntry: public cmPolicies::PolicyMap
@@ -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->ProjectName = name;
+}
+
+std::string cmState::Snapshot::GetProjectName() const
+{
+ return this->Position->BuildSystemDirectory->DirectoryEnd->ProjectName;
+}
+
cmState::Directory::Directory(
cmLinkedTree<BuildsystemDirectoryStateType>::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,
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=660c297e03628a15c10fe9d3b325dabbdd6f3201
commit 660c297e03628a15c10fe9d3b325dabbdd6f3201
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Aug 2 10:57:31 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Aug 24 22:39:56 2015 +0200
cmMakefile: Use std::string in ProjectName API.
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 591a2cd..7da334e 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -115,7 +115,9 @@ void CCONV cmAddCacheDefinition(void *arg, const char* name,
const char* CCONV cmGetProjectName(void *arg)
{
cmMakefile *mf = static_cast<cmMakefile *>(arg);
- return mf->GetProjectName();
+ static std::string name;
+ name = mf->GetProjectName();
+ return name.c_str();
}
const char* CCONV cmGetHomeDirectory(void *arg)
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 73911a5..abdd767 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2044,12 +2044,12 @@ void cmMakefile::RemoveCacheDefinition(const std::string& name)
this->GetState()->RemoveCacheEntry(name);
}
-void cmMakefile::SetProjectName(const char* p)
+void cmMakefile::SetProjectName(std::string const& p)
{
this->ProjectName = p;
}
-const char* cmMakefile::GetProjectName() const
+std::string cmMakefile::GetProjectName() const
{
return this->ProjectName.c_str();
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 959f0e7..dfd3e19 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -274,12 +274,12 @@ public:
/**
* Specify the name of the project for this build.
*/
- void SetProjectName(const char*);
+ void SetProjectName(std::string const& name);
/**
* Get the name of the project for this build.
*/
- const char* GetProjectName() const;
+ std::string GetProjectName() const;
/** Get the configurations to be generated. */
std::string GetConfigurations(std::vector<std::string>& configs,
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 46d7e01..7123125 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -20,7 +20,7 @@ bool cmProjectCommand
this->SetError("PROJECT called with incorrect number of arguments");
return false;
}
- this->Makefile->SetProjectName(args[0].c_str());
+ this->Makefile->SetProjectName(args[0]);
std::string bindir = args[0];
bindir += "_BINARY_DIR";
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5cb05849d91a178621011729d6c409f91cb011c6
commit 5cb05849d91a178621011729d6c409f91cb011c6
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Aug 2 10:56:33 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Aug 24 22:39:54 2015 +0200
cmMakefile: Out-of-line GetProjectName.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 2296d5a..73911a5 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2049,6 +2049,10 @@ void cmMakefile::SetProjectName(const char* p)
this->ProjectName = p;
}
+const char* cmMakefile::GetProjectName() const
+{
+ return this->ProjectName.c_str();
+}
void cmMakefile::AddGlobalLinkInformation(const std::string& name,
cmTarget& target)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 055170a..959f0e7 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -279,10 +279,7 @@ public:
/**
* Get the name of the project for this build.
*/
- const char* GetProjectName() const
- {
- return this->ProjectName.c_str();
- }
+ const char* GetProjectName() const;
/** Get the configurations to be generated. */
std::string GetConfigurations(std::vector<std::string>& configs,
-----------------------------------------------------------------------
Summary of changes:
Source/cmCPluginAPI.cxx | 4 +++-
Source/cmGlobalGenerator.cxx | 11 ++++++-----
Source/cmMakefile.cxx | 10 +++++++---
Source/cmMakefile.h | 9 ++-------
Source/cmProjectCommand.cxx | 2 +-
Source/cmState.cxx | 12 ++++++++++++
Source/cmState.h | 3 +++
7 files changed, 34 insertions(+), 17 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list