summaryrefslogtreecommitdiff
path: root/Source/cmProjectCommand.cxx
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2019-07-08 23:01:22 +0300
committerBrad King <brad.king@kitware.com>2019-07-15 08:17:36 -0400
commit638383c38f58941692544401c44dfbce9c7ff2d9 (patch)
tree6e085d334115e223a7316b7dffafa78eaae84177 /Source/cmProjectCommand.cxx
parent9b6a53292f9183bd5ae59c24f8fc1d76c5e187c8 (diff)
downloadcmake-638383c38f58941692544401c44dfbce9c7ff2d9.tar.gz
Refactor: Eliminate one-time-used variables
Diffstat (limited to 'Source/cmProjectCommand.cxx')
-rw-r--r--Source/cmProjectCommand.cxx18
1 files changed, 6 insertions, 12 deletions
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index a703e40dfc..a4ed300648 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -33,25 +33,19 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
this->Makefile->SetProjectName(projectName);
- std::string bindir = projectName;
- bindir += "_BINARY_DIR";
- std::string srcdir = projectName;
- srcdir += "_SOURCE_DIR";
-
this->Makefile->AddCacheDefinition(
- bindir, this->Makefile->GetCurrentBinaryDirectory().c_str(),
+ projectName + "_BINARY_DIR",
+ this->Makefile->GetCurrentBinaryDirectory().c_str(),
"Value Computed by CMake", cmStateEnums::STATIC);
this->Makefile->AddCacheDefinition(
- srcdir, this->Makefile->GetCurrentSourceDirectory().c_str(),
+ projectName + "_SOURCE_DIR",
+ this->Makefile->GetCurrentSourceDirectory().c_str(),
"Value Computed by CMake", cmStateEnums::STATIC);
- bindir = "PROJECT_BINARY_DIR";
- srcdir = "PROJECT_SOURCE_DIR";
-
this->Makefile->AddDefinition(
- bindir, this->Makefile->GetCurrentBinaryDirectory().c_str());
+ "PROJECT_BINARY_DIR", this->Makefile->GetCurrentBinaryDirectory().c_str());
this->Makefile->AddDefinition(
- srcdir, this->Makefile->GetCurrentSourceDirectory().c_str());
+ "PROJECT_SOURCE_DIR", this->Makefile->GetCurrentSourceDirectory().c_str());
this->Makefile->AddDefinition("PROJECT_NAME", projectName.c_str());