diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 0f49b6c356..d31b3b7683 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -634,10 +634,9 @@ void cmFindBase::StoreFindResult(std::string const& value) } } -cmFindBaseDebugState::cmFindBaseDebugState(std::string commandName, - cmFindBase const* findBase) +cmFindBaseDebugState::cmFindBaseDebugState(cmFindBase const* findBase) : FindCommand(findBase) - , CommandName(std::move(commandName)) + , CommandName(findBase->FindCommandName) { } diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h index 092ed3489d..fd9061bf60 100644 --- a/Source/cmFindBase.h +++ b/Source/cmFindBase.h @@ -95,7 +95,7 @@ private: class cmFindBaseDebugState { public: - explicit cmFindBaseDebugState(std::string name, cmFindBase const* findBase); + explicit cmFindBaseDebugState(cmFindBase const* findBase); ~cmFindBaseDebugState(); void FoundAt(std::string const& path, std::string regexName = std::string()); diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 62c1fb42db..01d7f1ed5e 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -191,8 +191,7 @@ std::string cmFindLibraryCommand::FindLibrary() struct cmFindLibraryHelper { - cmFindLibraryHelper(std::string debugName, cmMakefile* mf, - cmFindBase const* findBase); + cmFindLibraryHelper(cmMakefile* mf, cmFindBase const* findBase); // Context information. cmMakefile* Makefile; @@ -306,12 +305,12 @@ std::string const& get_suffixes(cmMakefile* mf) return (suffixProp) ? *suffixProp : defaultSuffix; } } -cmFindLibraryHelper::cmFindLibraryHelper(std::string debugName, cmMakefile* mf, +cmFindLibraryHelper::cmFindLibraryHelper(cmMakefile* mf, cmFindBase const* base) : Makefile(mf) , FindBase(base) , DebugMode(base->DebugModeEnabled()) - , DebugSearches(std::move(debugName), base) + , DebugSearches(base) { this->GG = this->Makefile->GetGlobalGenerator(); @@ -540,7 +539,7 @@ std::string cmFindLibraryCommand::FindNormalLibrary() std::string cmFindLibraryCommand::FindNormalLibraryNamesPerDir() { // Search for all names in each directory. - cmFindLibraryHelper helper(this->FindCommandName, this->Makefile, this); + cmFindLibraryHelper helper(this->Makefile, this); for (std::string const& n : this->Names) { helper.AddName(n); } @@ -557,7 +556,7 @@ std::string cmFindLibraryCommand::FindNormalLibraryNamesPerDir() std::string cmFindLibraryCommand::FindNormalLibraryDirsPerName() { // Search the entire path for each name. - cmFindLibraryHelper helper(this->FindCommandName, this->Makefile, this); + cmFindLibraryHelper helper(this->Makefile, this); for (std::string const& n : this->Names) { // Switch to searching for this name. helper.SetName(n); diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index c125984297..1eec555bbf 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -49,7 +49,7 @@ bool cmFindPathCommand::InitialPass(std::vector const& argsIn) std::string cmFindPathCommand::FindHeader() { - cmFindBaseDebugState debug(this->FindCommandName, this); + cmFindBaseDebugState debug(this); std::string header; if (this->SearchFrameworkFirst || this->SearchFrameworkOnly) { header = this->FindFrameworkHeader(debug); diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 3eebe484c9..b188aabc27 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -4,7 +4,6 @@ #include #include -#include #include "cmMakefile.h" #include "cmMessageType.h" @@ -25,9 +24,8 @@ class cmExecutionStatus; struct cmFindProgramHelper { - cmFindProgramHelper(std::string debugName, cmMakefile* makefile, - cmFindBase const* base) - : DebugSearches(std::move(debugName), base) + cmFindProgramHelper(cmMakefile* makefile, cmFindBase const* base) + : DebugSearches(base) , Makefile(makefile) , FindBase(base) , PolicyCMP0109(makefile->GetPolicyStatus(cmPolicies::CMP0109)) @@ -233,7 +231,7 @@ std::string cmFindProgramCommand::FindNormalProgram() std::string cmFindProgramCommand::FindNormalProgramNamesPerDir() { // Search for all names in each directory. - cmFindProgramHelper helper(this->FindCommandName, this->Makefile, this); + cmFindProgramHelper helper(this->Makefile, this); for (std::string const& n : this->Names) { helper.AddName(n); } @@ -256,7 +254,7 @@ std::string cmFindProgramCommand::FindNormalProgramNamesPerDir() std::string cmFindProgramCommand::FindNormalProgramDirsPerName() { // Search the entire path for each name. - cmFindProgramHelper helper(this->FindCommandName, this->Makefile, this); + cmFindProgramHelper helper(this->Makefile, this); for (std::string const& n : this->Names) { // Switch to searching for this name. helper.SetName(n);