cmSystemTools: MessageCallback and Message() accept std::string argument

This commit is contained in:
Vitaly Stakhovsky
2019-02-06 15:00:00 -05:00
parent 062cfd991f
commit 82edd98300
12 changed files with 35 additions and 34 deletions

View File

@@ -150,7 +150,7 @@ int main(int argc, char const* const* argv)
}
cmSystemTools::SetMessageCallback(
[myform](const char* message, const char* title) {
[myform](const std::string& message, const char* title) {
myform->AddError(message, title);
});

View File

@@ -9,6 +9,8 @@
#include "cmsys/FStream.hxx"
#include <string>
class cmCursesForm
{
public:
@@ -34,7 +36,7 @@ public:
// Description:
// During a CMake run, an error handle should add errors
// to be displayed afterwards.
virtual void AddError(const char*, const char*) {}
virtual void AddError(const std::string&, const char*) {}
// Description:
// Turn debugging on. This will create ccmakelog.txt.

View File

@@ -647,7 +647,8 @@ int cmCursesMainForm::Generate()
return 0;
}
void cmCursesMainForm::AddError(const char* message, const char* /*unused*/)
void cmCursesMainForm::AddError(const std::string& message,
const char* /*unused*/)
{
this->Errors.emplace_back(message);
}

View File

@@ -81,7 +81,7 @@ public:
* During a CMake run, an error handle should add errors
* to be displayed afterwards.
*/
void AddError(const char* message, const char* title) override;
void AddError(const std::string& message, const char* title) override;
/**
* Used to do a configure. If argument is specified, it does only the check