Add argument to arg parsing to not set directories

Argument parsing sets the source/build directories, but they may have
been (meaningfully) set before hand. Let's not overwrite them.
This commit is contained in:
Ben Boeckel 2010-10-05 13:44:28 -04:00
parent 367e5c37bb
commit 5aa535bdcb
2 changed files with 3 additions and 3 deletions

View File

@ -524,9 +524,9 @@ void cmake::ReadListFile(const char *path)
} }
// Parse the args // Parse the args
void cmake::SetArgs(const std::vector<std::string>& args) void cmake::SetArgs(const std::vector<std::string>& args, bool directoriesSetBefore)
{ {
bool directoriesSet = false; bool directoriesSet = directoriesSetBefore;
for(unsigned int i=1; i < args.size(); ++i) for(unsigned int i=1; i < args.size(); ++i)
{ {
std::string arg = args[i]; std::string arg = args[i];

View File

@ -212,7 +212,7 @@ class cmake
bool CommandExists(const char* name) const; bool CommandExists(const char* name) const;
///! Parse command line arguments ///! Parse command line arguments
void SetArgs(const std::vector<std::string>&); void SetArgs(const std::vector<std::string>&, bool directoriesSetBefore = false);
///! Is this cmake running as a result of a TRY_COMPILE command ///! Is this cmake running as a result of a TRY_COMPILE command
bool GetIsInTryCompile() { return this->InTryCompile; } bool GetIsInTryCompile() { return this->InTryCompile; }