cmMakefile: Use std::string in ProjectName API.
This commit is contained in:
parent
e8c0341d86
commit
6ce940ac97
|
@ -115,7 +115,9 @@ void CCONV cmAddCacheDefinition(void *arg, const char* name,
|
||||||
const char* CCONV cmGetProjectName(void *arg)
|
const char* CCONV cmGetProjectName(void *arg)
|
||||||
{
|
{
|
||||||
cmMakefile *mf = static_cast<cmMakefile *>(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)
|
const char* CCONV cmGetHomeDirectory(void *arg)
|
||||||
|
|
|
@ -2044,12 +2044,12 @@ void cmMakefile::RemoveCacheDefinition(const std::string& name)
|
||||||
this->GetState()->RemoveCacheEntry(name);
|
this->GetState()->RemoveCacheEntry(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefile::SetProjectName(const char* p)
|
void cmMakefile::SetProjectName(std::string const& p)
|
||||||
{
|
{
|
||||||
this->ProjectName = p;
|
this->ProjectName = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* cmMakefile::GetProjectName() const
|
std::string cmMakefile::GetProjectName() const
|
||||||
{
|
{
|
||||||
return this->ProjectName.c_str();
|
return this->ProjectName.c_str();
|
||||||
}
|
}
|
||||||
|
|
|
@ -274,12 +274,12 @@ public:
|
||||||
/**
|
/**
|
||||||
* Specify the name of the project for this build.
|
* 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.
|
* Get the name of the project for this build.
|
||||||
*/
|
*/
|
||||||
const char* GetProjectName() const;
|
std::string GetProjectName() const;
|
||||||
|
|
||||||
/** Get the configurations to be generated. */
|
/** Get the configurations to be generated. */
|
||||||
std::string GetConfigurations(std::vector<std::string>& configs,
|
std::string GetConfigurations(std::vector<std::string>& configs,
|
||||||
|
|
|
@ -20,7 +20,7 @@ bool cmProjectCommand
|
||||||
this->SetError("PROJECT called with incorrect number of arguments");
|
this->SetError("PROJECT called with incorrect number of arguments");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this->Makefile->SetProjectName(args[0].c_str());
|
this->Makefile->SetProjectName(args[0]);
|
||||||
|
|
||||||
std::string bindir = args[0];
|
std::string bindir = args[0];
|
||||||
bindir += "_BINARY_DIR";
|
bindir += "_BINARY_DIR";
|
||||||
|
|
Loading…
Reference in New Issue