ENH: fix for bug 1866, make -G,-D -C options allow for space between arg and value
This commit is contained in:
parent
a13713818c
commit
9062e6d922
|
@ -246,6 +246,10 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
|
||||||
if(arg.find("-D",0) == 0)
|
if(arg.find("-D",0) == 0)
|
||||||
{
|
{
|
||||||
std::string entry = arg.substr(2);
|
std::string entry = arg.substr(2);
|
||||||
|
if(entry.size() == 0)
|
||||||
|
{
|
||||||
|
entry = args[++i];
|
||||||
|
}
|
||||||
std::string var, value;
|
std::string var, value;
|
||||||
cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED;
|
cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED;
|
||||||
if(cmCacheManager::ParseEntry(entry.c_str(), var, value, type) ||
|
if(cmCacheManager::ParseEntry(entry.c_str(), var, value, type) ||
|
||||||
|
@ -268,8 +272,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
|
||||||
std::string path = arg.substr(2);
|
std::string path = arg.substr(2);
|
||||||
if ( path.size() == 0 )
|
if ( path.size() == 0 )
|
||||||
{
|
{
|
||||||
cmSystemTools::Error("No initial cache file provided.");
|
path = args[++i];
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
std::cerr << "loading initial cache file " << path.c_str() << "\n";
|
std::cerr << "loading initial cache file " << path.c_str() << "\n";
|
||||||
this->ReadListFile(path.c_str());
|
this->ReadListFile(path.c_str());
|
||||||
|
@ -384,6 +387,10 @@ void cmake::SetArgs(const std::vector<std::string>& args)
|
||||||
else if(arg.find("-G",0) == 0)
|
else if(arg.find("-G",0) == 0)
|
||||||
{
|
{
|
||||||
std::string value = arg.substr(2);
|
std::string value = arg.substr(2);
|
||||||
|
if(value.size() == 0)
|
||||||
|
{
|
||||||
|
value = args[++i];
|
||||||
|
}
|
||||||
cmGlobalGenerator* gen =
|
cmGlobalGenerator* gen =
|
||||||
this->CreateGlobalGenerator(value.c_str());
|
this->CreateGlobalGenerator(value.c_str());
|
||||||
if(!gen)
|
if(!gen)
|
||||||
|
|
Loading…
Reference in New Issue