summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-12-03 22:00:43 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-12-03 22:00:43 (GMT)
commitb545988c0b33cefccbc78bdaa97fe268a5176754 (patch)
tree402e855b1f916da67e232828194b7c279e2e9ba4 /Source/cmake.cxx
parent906f0a33398a16e95b047f07e8dd1c8e7f3b0375 (diff)
downloadCMake-b545988c0b33cefccbc78bdaa97fe268a5176754.zip
CMake-b545988c0b33cefccbc78bdaa97fe268a5176754.tar.gz
CMake-b545988c0b33cefccbc78bdaa97fe268a5176754.tar.bz2
ENH: add -C load cache file option
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx30
1 files changed, 23 insertions, 7 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 7af6931..3c40885 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -66,10 +66,13 @@ void cmake::Usage(const char* program)
{
std::cerr << "cmake version " << cmMakefile::GetMajorVersion()
<< "." << cmMakefile::GetMinorVersion() << "\n";
- std::cerr << "Usage: " << program << " srcdir [options]\n"
- << "Where cmake is run from the directory where you want the object files written\n";
+ std::cerr << "Usage: " << program << " [srcdir] [options]\n"
+ << "Where cmake is run from the directory where you want the object files written. If srcdir is not specified, the current directory is used for both source and object files.\n";
std::cerr << "Options are:\n";
- std::cerr << "[-GgeneratorName] (where generator name can be one of these: ";
+ std::cerr << "\n-i (puts cmake in wizard mode, not available for ccmake)\n";
+ std::cerr << "\n-DVAR:TYPE=VALUE (create a cache file entry)\n";
+ std::cerr << "\n-Cpath_to_initial_cache (a cmake list file that is used to pre-load the cache with values.)\n";
+ std::cerr << "\n[-GgeneratorName] (where generator name can be one of these: ";
std::vector<std::string> names;
cmMakefileGenerator::GetRegisteredGenerators(names);
for(std::vector<std::string>::iterator i =names.begin();
@@ -77,13 +80,12 @@ void cmake::Usage(const char* program)
{
std::cerr << "\"" << i->c_str() << "\" ";
}
- std::cerr << ")";
- std::cerr << "\n-DVAR:TYPE=VALUE (create a cache file entry)";
- std::cerr << "\n-i (puts cmake in wizard mode, not available for ccmake)\n";
+ std::cerr << ")\n";
}
// Parse the args
-void cmake::SetCacheArgs(cmMakefile& , const std::vector<std::string>& args)
+void cmake::SetCacheArgs(cmMakefile& builder,
+ const std::vector<std::string>& args)
{
for(unsigned int i=1; i < args.size(); ++i)
{
@@ -107,6 +109,16 @@ void cmake::SetCacheArgs(cmMakefile& , const std::vector<std::string>& args)
<< "Should be: VAR:type=value\n";
}
}
+ else if(arg.find("-C",0) == 0)
+ {
+ std::string path = arg.substr(2);
+ std::cerr << "loading initial cache file " << path.c_str() << "\n";
+ if(!builder.ReadListFile(path.c_str()))
+ {
+ std::cerr << "Error in reading cmake initial cache file:"
+ << path.c_str() << "\n";
+ }
+ }
}
}
@@ -175,6 +187,10 @@ void cmake::SetArgs(cmMakefile& builder, const std::vector<std::string>& args)
{
// skip for now
}
+ else if(arg.find("-C",0) == 0)
+ {
+ // skip for now
+ }
else if(arg.find("-G",0) == 0)
{
std::string value = arg.substr(2);