diff options
author | Paul Seyfert <pseyfert.mathphys@gmail.com> | 2018-10-23 19:04:34 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2019-01-10 10:19:24 (GMT) |
commit | 6d53a60f007b0a1a1c03ce5f9373eddc55f49d5a (patch) | |
tree | d20773cc3ffccb033315c5f93111639f19f8a72d /Source/cmake.cxx | |
parent | 9bbfbd54ba04e07b0bf2eb8bb1056bca53d639c5 (diff) | |
download | CMake-6d53a60f007b0a1a1c03ce5f9373eddc55f49d5a.zip CMake-6d53a60f007b0a1a1c03ce5f9373eddc55f49d5a.tar.gz CMake-6d53a60f007b0a1a1c03ce5f9373eddc55f49d5a.tar.bz2 |
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.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 889a5fb..1aff5eb 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -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++; |