diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-01-21 16:00:00 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-01-21 16:09:35 (GMT) |
commit | 5e54b0cf2f9706c731d9c188274ac2493587e86f (patch) | |
tree | 8f37f4b8df1271ae952b5ac0ad10773d07023f6f /Source/cmInstallGenerator.cxx | |
parent | 7a89e3c36cf919bf7c608456bcfd5d12978dc037 (diff) | |
download | CMake-5e54b0cf2f9706c731d9c188274ac2493587e86f.zip CMake-5e54b0cf2f9706c731d9c188274ac2493587e86f.tar.gz CMake-5e54b0cf2f9706c731d9c188274ac2493587e86f.tar.bz2 |
cmInstallGenerator: std::string params
Several construction parameters converted to std::string
Also made a few class members const
Diffstat (limited to 'Source/cmInstallGenerator.cxx')
-rw-r--r-- | Source/cmInstallGenerator.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx index ec17361..0665895 100644 --- a/Source/cmInstallGenerator.cxx +++ b/Source/cmInstallGenerator.cxx @@ -3,16 +3,17 @@ #include "cmInstallGenerator.h" #include <ostream> +#include <utility> #include "cmMakefile.h" #include "cmSystemTools.h" cmInstallGenerator::cmInstallGenerator( - const char* destination, std::vector<std::string> const& configurations, - const char* component, MessageLevel message, bool exclude_from_all) + std::string destination, std::vector<std::string> const& configurations, + std::string component, MessageLevel message, bool exclude_from_all) : cmScriptGenerator("CMAKE_INSTALL_CONFIG_NAME", configurations) - , Destination(destination ? destination : "") - , Component(component ? component : "") + , Destination(std::move(destination)) + , Component(std::move(component)) , Message(message) , ExcludeFromAll(exclude_from_all) { @@ -139,8 +140,8 @@ void cmInstallGenerator::AddInstallRule( os << ")\n"; } -std::string cmInstallGenerator::CreateComponentTest(const char* component, - bool exclude_from_all) +std::string cmInstallGenerator::CreateComponentTest( + const std::string& component, bool exclude_from_all) { std::string result = R"("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "x)"; result += component; @@ -158,7 +159,7 @@ void cmInstallGenerator::GenerateScript(std::ostream& os) // Begin this block of installation. std::string component_test = - this->CreateComponentTest(this->Component.c_str(), this->ExcludeFromAll); + this->CreateComponentTest(this->Component, this->ExcludeFromAll); os << indent << "if(" << component_test << ")\n"; // Generate the script possibly with per-configuration code. |