summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-06-03 17:19:15 (GMT)
committerBrad King <brad.king@kitware.com>2013-06-03 17:19:59 (GMT)
commit647745b3eedd0036d9e745007acd1d9cc460ccab (patch)
tree6b3e5cb90311ebaafd9abbdda033ec85803570dd
parent515f9af0d48be569adb51dfb43ff483cfc0d5156 (diff)
downloadCMake-647745b3eedd0036d9e745007acd1d9cc460ccab.zip
CMake-647745b3eedd0036d9e745007acd1d9cc460ccab.tar.gz
CMake-647745b3eedd0036d9e745007acd1d9cc460ccab.tar.bz2
variable_watch: Print accesses as "CMake Debug Log" messages
Use makefile->IssueMessage() to print the unprocessed watch message in a format consistent with other CMake messages and with a more complete call stack for the access.
-rw-r--r--Source/cmVariableWatchCommand.cxx8
-rw-r--r--Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt7
-rw-r--r--Tests/RunCMake/variable_watch/NoWatcher-stderr.txt7
3 files changed, 11 insertions, 11 deletions
diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx
index 8532930..297a92b 100644
--- a/Source/cmVariableWatchCommand.cxx
+++ b/Source/cmVariableWatchCommand.cxx
@@ -117,11 +117,9 @@ void cmVariableWatchCommand::VariableAccessed(const std::string& variable,
if ( !processed )
{
cmOStringStream msg;
- msg << "* Variable \"" << variable.c_str() << "\" was accessed using "
- << accessString << " in: " << currentListFile << std::endl;
- msg << " The value of the variable: \"" << newValue << "\"" << std::endl;
- msg << " The list file stack: " << stack.c_str();
- cmSystemTools::Message(msg.str().c_str());
+ msg << "Variable \"" << variable.c_str() << "\" was accessed using "
+ << accessString << " with value \"" << newValue << "\".";
+ makefile->IssueMessage(cmake::LOG, msg.str());
}
this->InCallback = false;
}
diff --git a/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt b/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt
index 3287626..3ff96fc 100644
--- a/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt
+++ b/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt
@@ -1,3 +1,4 @@
-\* Variable "b" was accessed using MODIFIED_ACCESS in: .*/Tests/RunCMake/variable_watch/ModifiedAccess.cmake
- The value of the variable: "b"
- The list file stack: .*/Tests/RunCMake/variable_watch/CMakeLists.txt;.*/Tests/RunCMake/variable_watch/ModifiedAccess.cmake
+CMake Debug Log at ModifiedAccess.cmake:3 \(set\):
+ Variable "b" was accessed using MODIFIED_ACCESS with value "b".
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt b/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt
index 95ff73b..d299429 100644
--- a/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt
+++ b/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt
@@ -1,4 +1,5 @@
my_func
-\* Variable "b" was accessed using MODIFIED_ACCESS in: .*/Tests/RunCMake/variable_watch/NoWatcher.cmake
- The value of the variable: ""
- The list file stack: .*/Tests/RunCMake/variable_watch/CMakeLists.txt;.*/Tests/RunCMake/variable_watch/NoWatcher.cmake$
+CMake Debug Log at NoWatcher.cmake:8 \(set\):
+ Variable "b" was accessed using MODIFIED_ACCESS with value "".
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$