diff options
author | Brad King <brad.king@kitware.com> | 2013-11-15 13:28:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-11-18 16:30:49 (GMT) |
commit | 4d1d7725f3e12399dd3785f5ffb7eae7db1be984 (patch) | |
tree | 9764acec4f649f8194d310dec9fa6ef22ad7ebf7 /Source | |
parent | 96966b5c804a95677e43e3938c52afbd42b5d48a (diff) | |
download | CMake-4d1d7725f3e12399dd3785f5ffb7eae7db1be984.zip CMake-4d1d7725f3e12399dd3785f5ffb7eae7db1be984.tar.gz CMake-4d1d7725f3e12399dd3785f5ffb7eae7db1be984.tar.bz2 |
ctest: Teach --build-options to allow zero options
The --build-options option consumes all following arguments until either
--build-target or --test-command. Fix the logic to allow this to be
zero options.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestBuildAndTestHandler.cxx | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 807a7e8..0fac136 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -513,23 +513,14 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments( { this->BuildNoClean = true; } - if(currentArg.find("--build-options",0) == 0 && idx < allArgs.size() - 1) + if(currentArg.find("--build-options",0) == 0) { - ++idx; - bool done = false; - while(idx < allArgs.size() && !done) + while(idx+1 < allArgs.size() && + allArgs[idx+1] != "--build-target" && + allArgs[idx+1] != "--test-command") { + ++idx; this->BuildOptions.push_back(allArgs[idx]); - if(idx+1 < allArgs.size() - && (allArgs[idx+1] == "--build-target" || - allArgs[idx+1] == "--test-command")) - { - done = true; - } - else - { - ++idx; - } } } if(currentArg.find("--test-command",0) == 0 && idx < allArgs.size() - 1) |