[cmake-developers] Introducing: message(DEBUG)
Rolf Eike Beer
eike at sf-mail.de
Sat Mar 3 09:05:37 EST 2012
Am Samstag, 3. März 2012, 17:05:11 schrieb Yury G. Kudryashov:
> Rolf Eike Beer wrote:
> > I have a small patch to CMake that looks like this:
> > + if (!this->Makefile->IsOn("CMAKE_DEBUG_MESSAGES"))
>
> I propose to print message if one of the following holds:
> * CMAKE_DEBUG_MESSAGES is true;
> * CMAKE_DEBUG_MESSAGES_FileName is true, where FileName is
> CMAKE_CURRENT_LIST_FILE's name without extension;
> * Current list file is CMakeLists.txt and
> CMAKE_DEBUG_MESSAGES_CurrentDirectory is true.
>
> This will allow
>
> # Turn all debug messages
> -DCMAKE_DEBUG_MESSAGES=ON
> # Turn all debug messages in FindBoost.cmake
> -DCMAKE_DEBUG_MESSAGES_FindBoost=ON
> # Turn all debug messages in mysubdir/CMakeLists.txt
> -DCMAKE_DEBUG_MESSAGES_mysubdir=ON
> # Turn all debug messages in **/CMakeLists.txt
> -DCMAKE_DEBUG_MESSAGES_CMakeLists=ON
I'm not absolutely sure if this is worth the effort. Not that it is generally a
bad idea, but it will likely require some code. The way you simply could do
this stuff is to just put "set(CMAKE_DEBUG_MESSAGES On)" at the beginning of
the subdir/module you want to debug and reset it at the end.
Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20120303/c4238ecb/attachment.sig>
More information about the cmake-developers
mailing list