From 638383c38f58941692544401c44dfbce9c7ff2d9 Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Mon, 8 Jul 2019 23:01:22 +0300 Subject: Refactor: Eliminate one-time-used variables --- Source/cmProjectCommand.cxx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index a703e40..a4ed300 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -33,25 +33,19 @@ bool cmProjectCommand::InitialPass(std::vector 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()); -- cgit v0.12