summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-02 08:57:31 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-25 17:55:34 (GMT)
commit6ce940ac9701c93be01ed169c6bd23b22e04782f (patch)
treea772611160eeee031c2a6f25d7e4b0fae7a42736 /Source
parente8c0341d86e3f2b9658dfc594641f9ba1b29165b (diff)
downloadCMake-6ce940ac9701c93be01ed169c6bd23b22e04782f.zip
CMake-6ce940ac9701c93be01ed169c6bd23b22e04782f.tar.gz
CMake-6ce940ac9701c93be01ed169c6bd23b22e04782f.tar.bz2
cmMakefile: Use std::string in ProjectName API.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCPluginAPI.cxx4
-rw-r--r--Source/cmMakefile.cxx4
-rw-r--r--Source/cmMakefile.h4
-rw-r--r--Source/cmProjectCommand.cxx2
4 files changed, 8 insertions, 6 deletions
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";