summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-10-29 15:19:34 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-10-29 15:19:34 (GMT)
commit539318f5875de0c0d0e008f820a3bd721d322f09 (patch)
treeedb941b33c894e7571f47d857e84a54f48b671d9 /Source/cmSystemTools.cxx
parent88c32dacc7a193a0a05b5c85daa973a56d580d67 (diff)
downloadCMake-539318f5875de0c0d0e008f820a3bd721d322f09.zip
CMake-539318f5875de0c0d0e008f820a3bd721d322f09.tar.gz
CMake-539318f5875de0c0d0e008f820a3bd721d322f09.tar.bz2
ENH: add callback for message display
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,