summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-10-10 13:21:36 (GMT)
committerBrad King <brad.king@kitware.com>2019-10-10 13:21:36 (GMT)
commit580e322dcbc3cfe8cbe08491564fe2aeb727b811 (patch)
tree0579597d243cb6e91c1ac0421697507df3876580 /Source
parente5419f4f873d8c233c9903a813866bc0c759dfc9 (diff)
parent7bbddeb78d46193eda9c2a948040e50012fbe33b (diff)
downloadCMake-580e322dcbc3cfe8cbe08491564fe2aeb727b811.zip
CMake-580e322dcbc3cfe8cbe08491564fe2aeb727b811.tar.gz
CMake-580e322dcbc3cfe8cbe08491564fe2aeb727b811.tar.bz2
Merge branch 'rename_loglevel_option' into release-3.16
Merge-request: !3899
Diffstat (limited to 'Source')
-rw-r--r--Source/cmake.cxx11
-rw-r--r--Source/cmakemain.cxx5
2 files changed, 14 insertions, 2 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 02606c2..50f47af 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -725,7 +725,18 @@ void cmake::SetArgs(const std::vector<std::string>& args)
} else if (arg.find("--debug-output", 0) == 0) {
std::cout << "Running with debug output on.\n";
this->SetDebugOutputOn(true);
+ } else if (arg.find("--log-level=", 0) == 0) {
+ const auto logLevel =
+ StringToLogLevel(arg.substr(sizeof("--log-level=") - 1));
+ if (logLevel == LogLevel::LOG_UNDEFINED) {
+ cmSystemTools::Error("Invalid level specified for --log-level");
+ return;
+ }
+ this->SetLogLevel(logLevel);
} else if (arg.find("--loglevel=", 0) == 0) {
+ // This is supported for backward compatibility. This option only
+ // appeared in the 3.15.x release series and was renamed to
+ // --log-level in 3.16.0
const auto logLevel =
StringToLogLevel(arg.substr(sizeof("--loglevel=") - 1));
if (logLevel == LogLevel::LOG_UNDEFINED) {
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index cc00c81..6d3e6ee 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -70,8 +70,9 @@ const char* cmDocumentationOptions[][2] = {
"Generate graphviz of dependencies, see "
"CMakeGraphVizOptions.cmake for more." },
{ "--system-information [file]", "Dump information about this system." },
- { "--loglevel=<ERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE>",
- "Set the verbosity of messages from CMake files." },
+ { "--log-level=<ERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE>",
+ "Set the verbosity of messages from CMake files. "
+ "--loglevel is also accepted for backward compatibility reasons." },
{ "--debug-trycompile",
"Do not delete the try_compile build tree. Only "
"useful on one try_compile at a time." },