Commit 6d53a60f authored by Paul Seyfert's avatar Paul Seyfert Committed by Craig Scott
Browse files

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.
parent 9bbfbd54
......@@ -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++;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment