Ninja build system does not support a in-Makefile verbositiy switch. So we use cmake --build as a fall back to extract the CMAKE_VERBOSE_MAKEFILE property and pass it as an optional -v argument to Ninja.
Signed-off-by: Gregor Jasny <gja...@googlemail.com> --- Source/cmGlobalGenerator.cxx | 2 ++ Source/cmGlobalGenerator.h | 5 +++++ Source/cmGlobalNinjaGenerator.cxx | 5 +++++ Source/cmake.cxx | 5 +++++ 4 files changed, 17 insertions(+) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 6147009..0a4e60a 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -69,6 +69,8 @@ cmGlobalGenerator::cmGlobalGenerator() this->ExtraGenerator = 0; this->CurrentLocalGenerator = 0; this->TryCompileOuterMakefile = 0; + + this->VerboseBuild = false; } cmGlobalGenerator::~cmGlobalGenerator() diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 08f061a..1e948f3 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -349,6 +349,9 @@ public: std::set<cmTarget const*> const& GetFilenameTargetDepends(cmSourceFile* sf) const; + void SetVerboseBuild(bool verbose) { this->VerboseBuild = verbose; } + bool GetVerboseBuild() const { return this->VerboseBuild; } + #if defined(CMAKE_BUILD_WITH_CMAKE) cmFileLockPool& GetFileLockPool() { return FileLockPool; } #endif @@ -506,6 +509,8 @@ private: mutable std::map<cmSourceFile*, std::set<cmTarget const*> > FilenameTargetDepends; + bool VerboseBuild; + #if defined(CMAKE_BUILD_WITH_CMAKE) // Pool of file locks cmFileLockPool FileLockPool; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 3c07be1..850f891 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -580,6 +580,11 @@ void cmGlobalNinjaGenerator this->SelectMakeProgram(makeProgram) ); + if(GetVerboseBuild()) + { + makeCommand.push_back("-v"); + } + makeCommand.insert(makeCommand.end(), makeOptions.begin(), makeOptions.end()); if(!targetName.empty()) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 47be481..19835c4 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2789,6 +2789,11 @@ int cmake::Build(const std::string& dir, return 1; } projName = it.GetValue(); + if(it.Find("CMAKE_VERBOSE_MAKEFILE")) + { + bool verboseBuild = it.GetValueAsBool(); + gen->SetVerboseBuild(verboseBuild); + } return gen->Build("", dir, projName, target, output, -- 2.3.0 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers