I have a small patch to CMake that looks like this: diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index e1dbf34..ad24368 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -52,6 +52,18 @@ bool cmMessageCommand status = true; ++i; } + else if (*i == "DEBUG") + { + if (!this->Makefile->GetCMakeInstance()->GetDebugOutput()) + { + if (!this->Makefile->IsOn("CMAKE_DEBUG_MESSAGES")) + { + return true; + } + } + status = true; + ++i; + } for(;i != args.end(); ++i) {
The idea behind this is like that: you can write message(DEBUG ...) everywhere in your CMake code and it will just print out nothing. Once you run cmake -- debug-output these messages will behave like message(STATUS), i.e. give you their contents and call trace. If at the point of the message(DEBUG) call a variable CMAKE_DEBUG_MESSAGES is set the message will behave like a normal message(STATUS), too. This variable is a completely normal CMake variable, i.e. it follows the normal scoping rules. My idea is to go into Modules/Find*.cmake and e.g. replace if(Boost_DEBUG) message(...) endif() just by "CMAKE_DEBUG_MESSAGES |= Boost_DEBUG" message(DEBUG ...). Opinions? Eike
signature.asc
Description: This is a digitally signed message part.
-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers