summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 44474a5..577c8f0 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -93,6 +93,8 @@ inline int Chdir(const char* dir)
bool cmSystemTools::s_ErrorOccured = false;
+void (*cmSystemTools::s_ErrorCallback)(const char*, const char*, bool&);
+
// adds the elements of the env variable path to the arg passed in
void cmSystemTools::GetPath(std::vector<std::string>& path)
{
@@ -689,14 +691,25 @@ void cmSystemTools::Error(const char* m1, const char* m2,
cmSystemTools::Message(message.c_str(),"Error");
}
+
+void cmSystemTools::SetErrorCallback(ErrorCallback f)
+{
+ s_ErrorCallback = f;
+}
+
void cmSystemTools::Message(const char* m1, const char *title)
{
-#if defined(_WIN32) && !defined(__CYGWIN__)
static bool disableMessages = false;
if(disableMessages)
{
return;
}
+ if(s_ErrorCallback)
+ {
+ (*s_ErrorCallback)(m1, title, disableMessages);
+ return;
+ }
+#if defined(_WIN32) && !defined(__CYGWIN__)
std::string message = m1;
message += "\n\n(Press Cancel to suppress any further messages.)";
if(::MessageBox(0, message.c_str(), title,