From d40909a98298a97d879ceeb3b29dcdc858e85628 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Fri, 8 Oct 2021 09:14:18 +0900 Subject: Imported Upstream version 3.16.0 --- Source/cmSiteNameCommand.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Source/cmSiteNameCommand.cxx') diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 9f041bc5f..d47f121e0 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -4,18 +4,18 @@ #include "cmsys/RegularExpression.hxx" +#include "cmExecutionStatus.h" #include "cmMakefile.h" #include "cmStateTypes.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" -class cmExecutionStatus; - // cmSiteNameCommand -bool cmSiteNameCommand::InitialPass(std::vector const& args, - cmExecutionStatus&) +bool cmSiteNameCommand(std::vector const& args, + cmExecutionStatus& status) { if (args.size() != 1) { - this->SetError("called with incorrect number of arguments"); + status.SetError("called with incorrect number of arguments"); return false; } std::vector paths; @@ -26,12 +26,12 @@ bool cmSiteNameCommand::InitialPass(std::vector const& args, paths.emplace_back("/sbin"); paths.emplace_back("/usr/local/bin"); - const char* cacheValue = this->Makefile->GetDefinition(args[0]); + const char* cacheValue = status.GetMakefile().GetDefinition(args[0]); if (cacheValue) { return true; } - const char* temp = this->Makefile->GetDefinition("HOSTNAME"); + const char* temp = status.GetMakefile().GetDefinition("HOSTNAME"); std::string hostname_cmd; if (temp) { hostname_cmd = temp; @@ -50,7 +50,7 @@ bool cmSiteNameCommand::InitialPass(std::vector const& args, } #else // try to find the hostname for this computer - if (!cmSystemTools::IsOff(hostname_cmd)) { + if (!cmIsOff(hostname_cmd)) { std::string host; cmSystemTools::RunSingleCommand(hostname_cmd, &host, nullptr, nullptr, nullptr, cmSystemTools::OUTPUT_NONE); @@ -71,7 +71,7 @@ bool cmSiteNameCommand::InitialPass(std::vector const& args, } } #endif - this->Makefile->AddCacheDefinition( + status.GetMakefile().AddCacheDefinition( args[0], siteName.c_str(), "Name of the computer/site where compile is being run", cmStateEnums::STRING); -- cgit v1.2.3