diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 41a325feb0..f69c185798 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1543,11 +1543,11 @@ void cmake::SetArgs(std::vector const& args) if (!parsedCorrectly) { cmSystemTools::Error("Run 'cmake --help' for all supported options."); exit(1); - } else if (!matched && cmHasPrefix(arg, '-')) { - possibleUnknownArg = arg; - } else if (!matched) { - bool parsedDirectory = this->SetDirectoriesFromFile(arg); - if (!parsedDirectory) { + } + if (!matched) { + if (cmHasPrefix(arg, '-')) { + possibleUnknownArg = arg; + } else if (!this->SetDirectoriesFromFile(arg)) { extraProvidedPath = arg; } }