summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-07-19 21:16:23 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-07-19 21:16:23 (GMT)
commit9062e6d922956bd374d626498a382d02804bbf83 (patch)
tree11175f8b368be4559d3165f99dea659756ac6433 /Source/cmake.cxx
parenta13713818cea07e565bdda8463f054e3d2ccd1fa (diff)
downloadCMake-9062e6d922956bd374d626498a382d02804bbf83.zip
CMake-9062e6d922956bd374d626498a382d02804bbf83.tar.gz
CMake-9062e6d922956bd374d626498a382d02804bbf83.tar.bz2
ENH: fix for bug 1866, make -G,-D -C options allow for space between arg and value
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index e108e18..c64e3b2 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -246,6 +246,10 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
if(arg.find("-D",0) == 0)
{
std::string entry = arg.substr(2);
+ if(entry.size() == 0)
+ {
+ entry = args[++i];
+ }
std::string var, value;
cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED;
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);
if ( path.size() == 0 )
{
- cmSystemTools::Error("No initial cache file provided.");
- return false;
+ path = args[++i];
}
std::cerr << "loading initial cache file " << path.c_str() << "\n";
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)
{
std::string value = arg.substr(2);
+ if(value.size() == 0)
+ {
+ value = args[++i];
+ }
cmGlobalGenerator* gen =
this->CreateGlobalGenerator(value.c_str());
if(!gen)