ENH: Argument for script mode is -P (process) and take out the automatic script mode

This commit is contained in:
Andy Cedilnik 2003-12-10 19:47:15 -05:00
parent 5acab1eed1
commit afc33a1990
2 changed files with 3 additions and 18 deletions

View File

@ -215,9 +215,9 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
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());
} }
else if(arg.find("--script",0) == 0) else if(arg.find("-P",0) == 0)
{ {
std::string path = arg.substr(strlen("--script")); std::string path = arg.substr(strlen("-P"));
if ( path.size() == 0 ) if ( path.size() == 0 )
{ {
cmSystemTools::Error("No cmake scrpt provided."); cmSystemTools::Error("No cmake scrpt provided.");

View File

@ -183,7 +183,7 @@ int do_cmake(int ac, char** av)
list_all_cached = true; list_all_cached = true;
list_help = true; list_help = true;
} }
else if (strncmp(av[i], "--script", strlen("--script")) == 0) else if (strncmp(av[i], "-P", strlen("-P")) == 0)
{ {
script_mode = true; script_mode = true;
args.push_back(av[i]); args.push_back(av[i]);
@ -194,21 +194,6 @@ int do_cmake(int ac, char** av)
} }
} }
if ( args.size() > 0 )
{
std::string &arg = args[args.size()-1];
if ( cmSystemTools::StringEndsWith(arg.c_str(), ".cmake") &&
cmSystemTools::FileExists(arg.c_str()) &&
!cmSystemTools::FileIsDirectory(arg.c_str()) )
{
std::vector<std::string>::iterator it = args.end();
-- it;
std::string ar = "--script" + arg;
args.insert(it, ar);
script_mode = 1;
}
}
if(command) if(command)
{ {
int ret = cmake::CMakeCommand(args); int ret = cmake::CMakeCommand(args);