summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-04-15 19:17:23 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2022-04-18 20:22:51 (GMT)
commit62f4a41647b146cebf9250e3ee873cb55d9bd7b6 (patch)
tree3db12219f933668ae16c36812097fede861b422c /Source/cmake.cxx
parent0645d08c98a94e69027727468e55938d4e095fba (diff)
downloadCMake-62f4a41647b146cebf9250e3ee873cb55d9bd7b6.zip
CMake-62f4a41647b146cebf9250e3ee873cb55d9bd7b6.tar.gz
CMake-62f4a41647b146cebf9250e3ee873cb55d9bd7b6.tar.bz2
Refactor: Use cmCommandLineArgument::setTo{True,Value}()
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx10
1 files changed, 2 insertions, 8 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 5bfc4c8..1c027ad 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -565,10 +565,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
"No install directory specified for --install-prefix",
CommandArgument::Values::One, PrefixLambda },
CommandArgument{ "--find-package", CommandArgument::Values::Zero,
- [&](std::string const&, cmake*) -> bool {
- findPackageMode = true;
- return true;
- } },
+ CommandArgument::setToTrue(findPackageMode) },
};
for (decltype(args.size()) i = 1; i < args.size(); ++i) {
std::string const& arg = args[i];
@@ -876,10 +873,7 @@ void cmake::SetArgs(const std::vector<std::string>& args)
CommandArgument{ "-P", "-P must be followed by a file name.",
CommandArgument::Values::One,
CommandArgument::RequiresSeparator::No,
- [&](std::string const&, cmake*) -> bool {
- scriptMode = true;
- return true;
- } },
+ CommandArgument::setToTrue(scriptMode) },
CommandArgument{ "-D", "-D must be followed with VAR=VALUE.",
CommandArgument::Values::One,
CommandArgument::RequiresSeparator::No,