diff options
author | David Cole <david.cole@kitware.com> | 2012-07-12 20:01:01 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-07-12 20:01:01 (GMT) |
commit | 0aafb8e230c7056e50c43c7e907233d99a58c285 (patch) | |
tree | 6d1360d51cf333bc5eadcd33b45472d5cf28d35c | |
parent | 3d1cea0b0db516c71d10e67505b19f13ef4a799a (diff) | |
parent | 8720aa0496bad1381a6636a3c4a6d5d550381960 (diff) | |
download | CMake-0aafb8e230c7056e50c43c7e907233d99a58c285.zip CMake-0aafb8e230c7056e50c43c7e907233d99a58c285.tar.gz CMake-0aafb8e230c7056e50c43c7e907233d99a58c285.tar.bz2 |
Merge topic 'fix-install-COMPONENT-option'
8720aa0 install: Fix COMPONENT option
-rw-r--r-- | Source/cmCommandArgumentsHelper.cxx | 2 | ||||
-rw-r--r-- | Source/cmCommandArgumentsHelper.h | 3 | ||||
-rw-r--r-- | Source/cmInstallCommandArguments.cxx | 7 | ||||
-rw-r--r-- | Source/cmInstallCommandArguments.h | 1 |
4 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx index 1c906a6..d920137 100644 --- a/Source/cmCommandArgumentsHelper.cxx +++ b/Source/cmCommandArgumentsHelper.cxx @@ -178,7 +178,7 @@ bool cmCAString::DoConsume(const std::string& arg, unsigned int index) void cmCAString::DoReset() { - this->String = this->DefaultString; + this->String = ""; } cmCAEnabler::cmCAEnabler(cmCommandArgumentsHelper* args, diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h index cb33ccd..3b0b058 100644 --- a/Source/cmCommandArgumentsHelper.h +++ b/Source/cmCommandArgumentsHelper.h @@ -125,11 +125,8 @@ class cmCAString : public cmCommandArgument /// Return the string const std::string& GetString() const {return this->String;} const char* GetCString() const {return this->String.c_str();} - void SetDefaultString(const char* text) - {this->DefaultString = (text ? text : "");} private: std::string String; - std::string DefaultString; unsigned int DataStart; virtual bool DoConsume(const std::string& arg, unsigned int index); virtual void DoReset(); diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx index 0ba21c7..8e48f08 100644 --- a/Source/cmInstallCommandArguments.cxx +++ b/Source/cmInstallCommandArguments.cxx @@ -36,8 +36,8 @@ cmInstallCommandArguments::cmInstallCommandArguments( ,NamelinkOnly (&Parser, "NAMELINK_ONLY" , &ArgumentGroup) ,NamelinkSkip (&Parser, "NAMELINK_SKIP" , &ArgumentGroup) ,GenericArguments(0) +,DefaultComponentName(defaultComponent) { - this->Component.SetDefaultString(defaultComponent.c_str()); } const std::string& cmInstallCommandArguments::GetDestination() const @@ -63,7 +63,10 @@ const std::string& cmInstallCommandArguments::GetComponent() const { return this->GenericArguments->GetComponent(); } - + if (!this->DefaultComponentName.empty()) + { + return this->DefaultComponentName; + } static std::string unspecifiedComponent = "Unspecified"; return unspecifiedComponent; } diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h index 321454a..01f7d56 100644 --- a/Source/cmInstallCommandArguments.h +++ b/Source/cmInstallCommandArguments.h @@ -61,6 +61,7 @@ class cmInstallCommandArguments cmInstallCommandArguments* GenericArguments; static const char* PermissionsTable[]; static const std::string EmptyString; + std::string DefaultComponentName; bool CheckPermissions(); }; |