mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
cmake: distinguish '-Cpath' from '-C path' in source dir parsing
This results in the correct source directory being picked up in calls
with
cmake sourcedir -C settings
and in a more appropriate error message when calling
mkdir build ; cd build ; cmake -C settings
Also fix `-D` and `-U` in the same way.
This commit is contained in:
@@ -676,10 +676,25 @@ void cmake::SetArgs(const std::vector<std::string>& args,
|
||||
#endif
|
||||
else if (arg.find("-D", 0) == 0) {
|
||||
// skip for now
|
||||
// in case '-D var=val' is given, also skip the next
|
||||
// in case '-Dvar=val' is given, don't skip the next
|
||||
if (arg.size() == 2) {
|
||||
++i;
|
||||
}
|
||||
} else if (arg.find("-U", 0) == 0) {
|
||||
// skip for now
|
||||
// in case '-U var' is given, also skip the next
|
||||
// in case '-Uvar' is given, don't skip the next
|
||||
if (arg.size() == 2) {
|
||||
++i;
|
||||
}
|
||||
} else if (arg.find("-C", 0) == 0) {
|
||||
// skip for now
|
||||
// in case '-C path' is given, also skip the next
|
||||
// in case '-Cpath' is given, don't skip the next
|
||||
if (arg.size() == 2) {
|
||||
++i;
|
||||
}
|
||||
} else if (arg.find("-P", 0) == 0) {
|
||||
// skip for now
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user