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 )
{
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;
}

View File

@ -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\)$

View File

@ -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\)$