|
@@ -291,7 +291,8 @@ void cmake::CleanupCommandsAndMacros()
|
|
|
// Parse the args
|
|
// Parse the args
|
|
|
bool cmake::SetCacheArgs(const std::vector<std::string>& args)
|
|
bool cmake::SetCacheArgs(const std::vector<std::string>& args)
|
|
|
{
|
|
{
|
|
|
- bool findPackageMode = false;
|
|
|
|
|
|
|
+ auto findPackageMode = false;
|
|
|
|
|
+ auto seenScriptOption = false;
|
|
|
for (unsigned int i = 1; i < args.size(); ++i) {
|
|
for (unsigned int i = 1; i < args.size(); ++i) {
|
|
|
std::string const& arg = args[i];
|
|
std::string const& arg = args[i];
|
|
|
if (cmHasLiteralPrefix(arg, "-D")) {
|
|
if (cmHasLiteralPrefix(arg, "-D")) {
|
|
@@ -446,6 +447,11 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
|
|
|
this->SetHomeOutputDirectory(
|
|
this->SetHomeOutputDirectory(
|
|
|
cmSystemTools::GetCurrentWorkingDirectory());
|
|
cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
this->ReadListFile(args, path);
|
|
this->ReadListFile(args, path);
|
|
|
|
|
+ seenScriptOption = true;
|
|
|
|
|
+ } else if (arg == "--" && seenScriptOption) {
|
|
|
|
|
+ // Stop processing CMake args and avoid possible errors
|
|
|
|
|
+ // when arbitrary args are given to CMake script.
|
|
|
|
|
+ break;
|
|
|
} else if (cmHasLiteralPrefix(arg, "--find-package")) {
|
|
} else if (cmHasLiteralPrefix(arg, "--find-package")) {
|
|
|
findPackageMode = true;
|
|
findPackageMode = true;
|
|
|
}
|
|
}
|