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.
This commit is contained in:
Brad King 2013-06-03 13:19:15 -04:00
parent 515f9af0d4
commit 647745b3ee
3 changed files with 11 additions and 11 deletions

View File

@ -117,11 +117,9 @@ void cmVariableWatchCommand::VariableAccessed(const std::string& variable,
if ( !processed ) if ( !processed )
{ {
cmOStringStream msg; cmOStringStream msg;
msg << "* Variable \"" << variable.c_str() << "\" was accessed using " msg << "Variable \"" << variable.c_str() << "\" was accessed using "
<< accessString << " in: " << currentListFile << std::endl; << accessString << " with value \"" << newValue << "\".";
msg << " The value of the variable: \"" << newValue << "\"" << std::endl; makefile->IssueMessage(cmake::LOG, msg.str());
msg << " The list file stack: " << stack.c_str();
cmSystemTools::Message(msg.str().c_str());
} }
this->InCallback = false; this->InCallback = false;
} }

View File

@ -1,3 +1,4 @@
\* Variable "b" was accessed using MODIFIED_ACCESS in: .*/Tests/RunCMake/variable_watch/ModifiedAccess.cmake CMake Debug Log at ModifiedAccess.cmake:3 \(set\):
The value of the variable: "b" Variable "b" was accessed using MODIFIED_ACCESS with value "b".
The list file stack: .*/Tests/RunCMake/variable_watch/CMakeLists.txt;.*/Tests/RunCMake/variable_watch/ModifiedAccess.cmake Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$

View File

@ -1,4 +1,5 @@
my_func my_func
\* Variable "b" was accessed using MODIFIED_ACCESS in: .*/Tests/RunCMake/variable_watch/NoWatcher.cmake CMake Debug Log at NoWatcher.cmake:8 \(set\):
The value of the variable: "" Variable "b" was accessed using MODIFIED_ACCESS with value "".
The list file stack: .*/Tests/RunCMake/variable_watch/CMakeLists.txt;.*/Tests/RunCMake/variable_watch/NoWatcher.cmake$ Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$