summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmCallVisualStudioMacro.cxx4
-rw-r--r--Source/cmComputeLinkInformation.cxx2
-rw-r--r--Source/cmFLTKWrapUICommand.cxx2
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx6
-rw-r--r--Source/cmGlobalGenerator.cxx2
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx2
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx4
-rw-r--r--Source/cmInstallCommand.cxx2
-rw-r--r--Source/cmInstallTargetGenerator.cxx2
-rw-r--r--Source/cmLocalGenerator.cxx4
-rw-r--r--Source/cmMakefile.cxx6
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmMessageCommand.cxx2
-rw-r--r--Source/cmMessenger.cxx4
-rw-r--r--Source/cmSystemTools.cxx4
-rw-r--r--Source/cmSystemTools.h4
-rw-r--r--Source/cmUtilitySourceCommand.cxx2
-rw-r--r--Source/cmake.cxx2
18 files changed, 30 insertions, 26 deletions
diff --git a/Source/cmCallVisualStudioMacro.cxx b/Source/cmCallVisualStudioMacro.cxx
index ecfcfb9657..ee5feee763 100644
--- a/Source/cmCallVisualStudioMacro.cxx
+++ b/Source/cmCallVisualStudioMacro.cxx
@@ -46,7 +46,7 @@ static bool LogErrorsAsMessages;
<< std::endl; \
_hresult_oss.flags(std::ios::dec); \
_hresult_oss << __FILE__ << "(" << __LINE__ << ")"; \
- cmSystemTools::Message(_hresult_oss.str().c_str()); \
+ cmSystemTools::Message(_hresult_oss.str()); \
} \
}
@@ -446,7 +446,7 @@ int cmCallVisualStudioMacro::CallMacro(const std::string& slnFile,
if (err && LogErrorsAsMessages) {
std::ostringstream oss;
oss << "cmCallVisualStudioMacro::CallMacro failed, err = " << err;
- cmSystemTools::Message(oss.str().c_str());
+ cmSystemTools::Message(oss.str());
}
return 0;
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index c68bb219b4..3d61665fd3 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1282,7 +1282,7 @@ void cmComputeLinkInformation::DropDirectoryItem(std::string const& item)
<< "\" requests linking to directory \"" << item << "\". "
<< "Targets may link only to libraries. "
<< "CMake is dropping the item.";
- cmSystemTools::Message(e.str().c_str());
+ cmSystemTools::Message(e.str());
}
void cmComputeLinkInformation::ComputeFrameworkInfo()
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index effb4460a9..4b14d26d07 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -117,7 +117,7 @@ void cmFLTKWrapUICommand::FinalPass()
msg += ". The problem was found while processing the source directory: ";
msg += this->Makefile->GetCurrentSourceDirectory();
msg += ". This FLTK_WRAP_UI call will be ignored.";
- cmSystemTools::Message(msg.c_str(), "Warning");
+ cmSystemTools::Message(msg, "Warning");
return;
}
}
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 19605e4c97..c253937529 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -67,7 +67,7 @@ void cmGhsMultiTargetGenerator::Generate()
case cmStateEnums::SHARED_LIBRARY: {
std::string msg = "add_library(<name> SHARED ...) not supported: ";
msg += this->Name;
- cmSystemTools::Message(msg.c_str());
+ cmSystemTools::Message(msg);
return;
}
case cmStateEnums::OBJECT_LIBRARY: {
@@ -84,13 +84,13 @@ void cmGhsMultiTargetGenerator::Generate()
case cmStateEnums::MODULE_LIBRARY: {
std::string msg = "add_library(<name> MODULE ...) not supported: ";
msg += this->Name;
- cmSystemTools::Message(msg.c_str());
+ cmSystemTools::Message(msg);
return;
}
case cmStateEnums::UTILITY: {
std::string msg = "add_custom_target(<name> ...) not supported: ";
msg += this->Name;
- cmSystemTools::Message(msg.c_str());
+ cmSystemTools::Message(msg);
return;
}
default:
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 04af0138e5..58d0971ee8 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1060,7 +1060,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l,
if (preference < 0) {
std::string msg = linkerPrefVar;
msg += " is negative, adjusting it to 0";
- cmSystemTools::Message(msg.c_str(), "Warning");
+ cmSystemTools::Message(msg, "Warning");
preference = 0;
}
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 7963c8a7ed..bb8b77249c 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -70,7 +70,7 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
"Green Hills MULTI: -T <toolset> not specified; defaulting to \"";
message += tsp;
message += "\"";
- cmSystemTools::Message(message.c_str());
+ cmSystemTools::Message(message);
/* store the full toolset for later use
* -- already done if -T<toolset> was specified
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index cbea3dda42..e3dd2f987c 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -268,7 +268,7 @@ void cmGlobalVisualStudioGenerator::ConfigureCMakeVisualStudioMacros()
std::ostringstream oss;
oss << "Could not copy from: " << src << std::endl;
oss << " to: " << dst << std::endl;
- cmSystemTools::Message(oss.str().c_str(), "Warning");
+ cmSystemTools::Message(oss.str(), "Warning");
}
}
@@ -783,7 +783,7 @@ void RegisterVisualStudioMacros(const std::string& macrosFile,
<< "CMake needs to register Visual Studio macros when its macros"
<< " file is updated or when it detects that its current macros file"
<< " is no longer registered with Visual Studio." << std::endl;
- cmSystemTools::Message(oss.str().c_str(), "Warning");
+ cmSystemTools::Message(oss.str(), "Warning");
// Count them again now that the warning is over. In the case of a GUI
// warning, the user may have gone to close Visual Studio and then come
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index c6f40641ed..8ef644141b 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -712,7 +712,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
std::ostringstream e;
e << "INSTALL TARGETS - target " << target.GetName() << " has "
<< "RESOURCE files but no RESOURCE DESTINATION.";
- cmSystemTools::Message(e.str().c_str(), "Warning");
+ cmSystemTools::Message(e.str(), "Warning");
}
}
}
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index d1d431653f..3497814638 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -51,7 +51,7 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
<< "\" has EXCLUDE_FROM_ALL set and will not be built by default "
<< "but an install rule has been provided for it. CMake does "
<< "not define behavior for this case.";
- cmSystemTools::Message(msg.str().c_str(), "Warning");
+ cmSystemTools::Message(msg.str(), "Warning");
}
// Perform the main install script generation.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 62aff99743..5b02823907 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2752,7 +2752,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
<< "CMake is dropping a preprocessor definition: " << define << "\n"
<< "Consider defining the macro in a (configured) header file.\n";
/* clang-format on */
- cmSystemTools::Message(e.str().c_str());
+ cmSystemTools::Message(e.str());
return false;
}
}
@@ -2767,7 +2767,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
<< "CMake is dropping a preprocessor definition: " << define << "\n"
<< "Consider defining the macro in a (configured) header file.\n";
/* clang-format on */
- cmSystemTools::Message(e.str().c_str());
+ cmSystemTools::Message(e.str());
return false;
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index b59a73372b..9bd3b01317 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -322,7 +322,7 @@ void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const
msg << " ";
}
msg << ")";
- cmSystemTools::Message(msg.str().c_str());
+ cmSystemTools::Message(msg.str());
}
// Helper class to make sure the call stack is valid.
@@ -1622,7 +1622,7 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf)
if (this->GetCMakeInstance()->GetDebugOutput()) {
std::string msg = " Entering ";
msg += currentStart;
- cmSystemTools::Message(msg.c_str());
+ cmSystemTools::Message(msg);
}
std::string const currentStartFile = currentStart + "/CMakeLists.txt";
@@ -1665,7 +1665,7 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf)
if (this->GetCMakeInstance()->GetDebugOutput()) {
std::string msg = " Returning to ";
msg += this->GetCurrentSourceDirectory();
- cmSystemTools::Message(msg.c_str());
+ cmSystemTools::Message(msg);
}
}
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 0fad2336f4..af34169c39 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -403,7 +403,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
err << "Warning: Source file \"" << source.GetFullPath()
<< "\" is listed multiple times for target \""
<< this->GeneratorTarget->GetName() << "\".";
- cmSystemTools::Message(err.str().c_str(), "Warning");
+ cmSystemTools::Message(err.str(), "Warning");
return;
}
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx
index 4c26c66686..95f5fcbbe9 100644
--- a/Source/cmMessageCommand.cxx
+++ b/Source/cmMessageCommand.cxx
@@ -70,7 +70,7 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,
if (status) {
this->Makefile->DisplayStatus(message.c_str(), -1);
} else {
- cmSystemTools::Message(message.c_str());
+ cmSystemTools::Message(message);
}
}
if (fatal) {
diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx
index 3d788f6927..1d790e2e8f 100644
--- a/Source/cmMessenger.cxx
+++ b/Source/cmMessenger.cxx
@@ -124,9 +124,9 @@ void displayMessage(MessageType t, std::ostringstream& msg)
if (t == MessageType::FATAL_ERROR || t == MessageType::INTERNAL_ERROR ||
t == MessageType::DEPRECATION_ERROR || t == MessageType::AUTHOR_ERROR) {
cmSystemTools::SetErrorOccured();
- cmSystemTools::Message(msg.str().c_str(), "Error");
+ cmSystemTools::Message(msg.str(), "Error");
} else {
- cmSystemTools::Message(msg.str().c_str(), "Warning");
+ cmSystemTools::Message(msg.str(), "Warning");
}
}
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index a16460f996..f7de3aa71e 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -267,14 +267,14 @@ void cmSystemTools::Error(const char* m1, const char* m2, const char* m3,
message += m4;
}
cmSystemTools::s_ErrorOccured = true;
- cmSystemTools::Message(message.c_str(), "Error");
+ cmSystemTools::Message(message, "Error");
}
void cmSystemTools::Error(const std::string& m)
{
std::string message = "CMake Error: " + m;
cmSystemTools::s_ErrorOccured = true;
- cmSystemTools::Message(message.c_str(), "Error");
+ cmSystemTools::Message(message, "Error");
}
void cmSystemTools::SetInterruptCallback(InterruptCallback f, void* clientData)
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index b30e4f7abf..b1d57512da 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -76,6 +76,10 @@ public:
* Display a message.
*/
static void Message(const char* m, const char* title = nullptr);
+ static void Message(const std::string& m, const char* title = nullptr)
+ {
+ Message(m.c_str(), title);
+ }
typedef void (*OutputCallback)(const char*, size_t length, void*);
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index f374626446..231bca41df 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -40,7 +40,7 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args,
msg += ". If your intention is to run this executable, you need to "
"preload the cache with the full path to a version of that "
"program, which runs on this build machine.";
- cmSystemTools::Message(msg.c_str(), "Warning");
+ cmSystemTools::Message(msg, "Warning");
}
} else {
cmState* state = this->Makefile->GetState();
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 744b8fce46..cf4dfc4879 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1252,7 +1252,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var)
for (SaveCacheEntry const& i : saved) {
this->AddCacheEntry(i.key, i.value.c_str(), i.help.c_str(), i.type);
}
- cmSystemTools::Message(warning.str().c_str());
+ cmSystemTools::Message(warning.str());
// avoid reconfigure if there were errors
if (!cmSystemTools::GetErrorOccuredFlag()) {
// re-run configure