diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-02-26 22:28:04 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2019-02-26 22:28:04 (GMT) |
commit | e795be115e9c40d6092958d64f251db435acc4ba (patch) | |
tree | 1474474ff28bcdcfd1fe0c64a2d4431e740266d7 /Source/cmakemain.cxx | |
parent | 4b95e7fe63d254b8e50f09f85a51e232a7470c7b (diff) | |
parent | 78ff8d573777c099aea5bd2eb92d9866c0d85952 (diff) | |
download | CMake-e795be115e9c40d6092958d64f251db435acc4ba.zip CMake-e795be115e9c40d6092958d64f251db435acc4ba.tar.gz CMake-e795be115e9c40d6092958d64f251db435acc4ba.tar.bz2 |
Merge branch 'master' into cmake_role-vs-fix
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r-- | Source/cmakemain.cxx | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index a83f7dc..e6f4021 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -142,20 +142,21 @@ static std::string cmakemainGetStack(cmake* cm) return msg; } -static void cmakemainMessageCallback(const char* m, const char* /*unused*/, - cmake* cm) +static void cmakemainMessageCallback(const std::string& m, + const char* /*unused*/, cmake* cm) { std::cerr << m << cmakemainGetStack(cm) << std::endl << std::flush; } -static void cmakemainProgressCallback(const char* m, float prog, cmake* cm) +static void cmakemainProgressCallback(const std::string& m, float prog, + cmake* cm) { cmMakefile* mf = cmakemainGetMakefile(cm); std::string dir; - if ((mf) && (strstr(m, "Configuring") == m) && (prog < 0)) { + if (mf && cmHasLiteralPrefix(m, "Configuring") && (prog < 0)) { dir = " "; dir += mf->GetCurrentSourceDirectory(); - } else if ((mf) && (strstr(m, "Generating") == m)) { + } else if (mf && cmHasLiteralPrefix(m, "Generating")) { dir = " "; dir += mf->GetCurrentBinaryDirectory(); } @@ -319,10 +320,11 @@ int do_cmake(int ac, char const* const* av) cmake cm(role, mode); cm.SetHomeDirectory(""); cm.SetHomeOutputDirectory(""); - cmSystemTools::SetMessageCallback([&cm](const char* msg, const char* title) { - cmakemainMessageCallback(msg, title, &cm); - }); - cm.SetProgressCallback([&cm](const char* msg, float prog) { + cmSystemTools::SetMessageCallback( + [&cm](const std::string& msg, const char* title) { + cmakemainMessageCallback(msg, title, &cm); + }); + cm.SetProgressCallback([&cm](const std::string& msg, float prog) { cmakemainProgressCallback(msg, prog, &cm); }); cm.SetWorkingMode(workingMode); @@ -499,10 +501,11 @@ static int do_build(int ac, char const* const* av) } cmake cm(cmake::RoleInternal, cmState::Project); - cmSystemTools::SetMessageCallback([&cm](const char* msg, const char* title) { - cmakemainMessageCallback(msg, title, &cm); - }); - cm.SetProgressCallback([&cm](const char* msg, float prog) { + cmSystemTools::SetMessageCallback( + [&cm](const std::string& msg, const char* title) { + cmakemainMessageCallback(msg, title, &cm); + }); + cm.SetProgressCallback([&cm](const std::string& msg, float prog) { cmakemainProgressCallback(msg, prog, &cm); }); return cm.Build(jobs, dir, target, config, nativeOptions, clean, verbose); @@ -541,10 +544,11 @@ static int do_open(int ac, char const* const* av) } cmake cm(cmake::RoleInternal, cmState::Unknown); - cmSystemTools::SetMessageCallback([&cm](const char* msg, const char* title) { - cmakemainMessageCallback(msg, title, &cm); - }); - cm.SetProgressCallback([&cm](const char* msg, float prog) { + cmSystemTools::SetMessageCallback( + [&cm](const std::string& msg, const char* title) { + cmakemainMessageCallback(msg, title, &cm); + }); + cm.SetProgressCallback([&cm](const std::string& msg, float prog) { cmakemainProgressCallback(msg, prog, &cm); }); return cm.Open(dir, false) ? 0 : 1; |