diff options
author | Florian Maushart <FloriansGit@online.ms> | 2019-01-24 18:31:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-28 14:44:50 (GMT) |
commit | 439fe2e253410305ff7018416ff5ff26aa851d53 (patch) | |
tree | 5fd4875e35c4c737b40e08a658db0e935df09fc9 /Source/cmakemain.cxx | |
parent | 638667efa2b0e5fff5c63bf936748a60b602ae90 (diff) | |
download | CMake-439fe2e253410305ff7018416ff5ff26aa851d53.zip CMake-439fe2e253410305ff7018416ff5ff26aa851d53.tar.gz CMake-439fe2e253410305ff7018416ff5ff26aa851d53.tar.bz2 |
cmake: Add options for verbose output to --build mode
While we already support `VERBOSE` environment variable and
`CMAKE_VERBOSE_MAKEFILE` cached variable, add `-v` and `--verbose`
command line options to be able to activate verbose output directly from
CMake's build tool mode command line.
Also make `msbuild` honor the verbosity setting. `xcodebuild` still
doesn't honor the verbosity setting as it will need a policy added
and reworking of cmGlobalGenerator and cmsys to support
multiple command invocation.
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r-- | Source/cmakemain.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 0c25498..0ec2552 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -68,6 +68,8 @@ static const char* cmDocumentationUsageNote[][2] = { " --clean-first = Build target 'clean' first, then build.\n" \ " (To clean only, use --target 'clean'.)\n" \ " --use-stderr = Ignored. Behavior is default in CMake >= 3.0.\n" \ + " -v --verbose = Enable verbose output - if supported - including\n" \ + " the build commands to be executed. \n" \ " -- = Pass remaining options to the native tool.\n" static const char* cmDocumentationOptions[][2] = { @@ -395,6 +397,7 @@ static int do_build(int ac, char const* const* av) std::string dir; std::vector<std::string> nativeOptions; bool clean = false; + bool verbose = cmSystemTools::HasEnv("VERBOSE"); bool hasTarget = false; enum Doing @@ -435,6 +438,10 @@ static int do_build(int ac, char const* const* av) } else if (strcmp(av[i], "--clean-first") == 0) { clean = true; doing = DoingNone; + } else if ((strcmp(av[i], "--verbose") == 0) || + (strcmp(av[i], "-v") == 0)) { + verbose = true; + doing = DoingNone; } else if (strcmp(av[i], "--use-stderr") == 0) { /* tolerate legacy option */ } else if (strcmp(av[i], "--") == 0) { @@ -493,7 +500,7 @@ static int do_build(int ac, char const* const* av) cmake cm(cmake::RoleInternal, cmState::Unknown); cmSystemTools::SetMessageCallback(cmakemainMessageCallback, &cm); cm.SetProgressCallback(cmakemainProgressCallback, &cm); - return cm.Build(jobs, dir, target, config, nativeOptions, clean); + return cm.Build(jobs, dir, target, config, nativeOptions, clean, verbose); #endif } |