Merge topic 'fix-install-COMPONENT-option'

8720aa0 install: Fix COMPONENT option
This commit is contained in:
David Cole 2012-07-12 16:01:01 -04:00 committed by CMake Topic Stage
commit 0aafb8e230
4 changed files with 7 additions and 6 deletions

View File

@ -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,

View File

@ -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();

View File

@ -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;
}

View File

@ -61,6 +61,7 @@ class cmInstallCommandArguments
cmInstallCommandArguments* GenericArguments;
static const char* PermissionsTable[];
static const std::string EmptyString;
std::string DefaultComponentName;
bool CheckPermissions();
};