summaryrefslogtreecommitdiffstats
path: root/Source/cmakemain.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2019-02-11 15:30:00 (GMT)
committerVitaly Stakhovsky <vvs31415@gitlab.org>2019-02-11 15:32:43 (GMT)
commit950c099d83757acd57cec78a3579ea1f6aaddf96 (patch)
tree87862c59076f42dc9c4be9c8c002e1fccfdb90cd /Source/cmakemain.cxx
parent8a1d25afdf92cabab88598cc9b9e5a9fb2a9493b (diff)
downloadCMake-950c099d83757acd57cec78a3579ea1f6aaddf96.zip
CMake-950c099d83757acd57cec78a3579ea1f6aaddf96.tar.gz
CMake-950c099d83757acd57cec78a3579ea1f6aaddf96.tar.bz2
cmake: Progress functions use `std::string` param
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r--Source/cmakemain.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index a49246b..09068f8 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -148,14 +148,15 @@ static void cmakemainMessageCallback(const std::string& m,
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();
}
@@ -323,7 +324,7 @@ int do_cmake(int ac, char const* const* av)
[&cm](const std::string& msg, const char* title) {
cmakemainMessageCallback(msg, title, &cm);
});
- cm.SetProgressCallback([&cm](const char* msg, float prog) {
+ cm.SetProgressCallback([&cm](const std::string& msg, float prog) {
cmakemainProgressCallback(msg, prog, &cm);
});
cm.SetWorkingMode(workingMode);
@@ -504,7 +505,7 @@ static int do_build(int ac, char const* const* av)
[&cm](const std::string& msg, const char* title) {
cmakemainMessageCallback(msg, title, &cm);
});
- cm.SetProgressCallback([&cm](const char* msg, float prog) {
+ cm.SetProgressCallback([&cm](const std::string& msg, float prog) {
cmakemainProgressCallback(msg, prog, &cm);
});
return cm.Build(jobs, dir, target, config, nativeOptions, clean, verbose);
@@ -547,7 +548,7 @@ static int do_open(int ac, char const* const* av)
[&cm](const std::string& msg, const char* title) {
cmakemainMessageCallback(msg, title, &cm);
});
- cm.SetProgressCallback([&cm](const char* msg, float prog) {
+ cm.SetProgressCallback([&cm](const std::string& msg, float prog) {
cmakemainProgressCallback(msg, prog, &cm);
});
return cm.Open(dir, false) ? 0 : 1;