Clion and CMake messages

Another possible workaround:

  • disable "cmake auto-reload" if it is enabled
  • after you changed something in your cmake file, don't trigger "Reload changes"
  • run/build your project

When clion starts a build, it realizes the cmake files are not up-to-date and reloads them, but like other build output it is displayed inside the Messages tab.


Use message(WARNING ...) instead of message(...). Warnings go to stderr.


Warning and errors are displayed, but other messages are currently suppressed. However, there is a feature request concerning this issue.


As of CLion 2016.2.2, Build #CL-162.1967.7, CLion is displaying CMake message(STATUS) output in its Messages tool window (Alt+0) during Build (Ctrl+F9) when a project is first built after changes to CMakeLists.txt. But as noted in the other answers, this output doesn't show in CLion's CMake tool window (as many would prefer).

Update: Above I wrote that CLion "is displaying message(STATUS) output." I now find that this occurs intermittently. @Michael wrote that this happens if you skip cmake reload after modifying your cmake file, but I've found CLion sometimes does not display any CMake output in its Messages tool window even under this condition. So far I haven't discovered the exact circumstances that make CLion show CMake message(STATUS) output, will report back here when/if I do.

Big Update: CLion opens 2016.3 EAP: user-defined literals, CMake output, C11 keywords completion and more. See in particular:CMake output window: a separate I think it fixes this whole problem: CLion 2016.3 EAP adds a new tab that contains CMake command output.

Of course, this is EAP, which comes with JetBrains' caveat:

It is important to distinguish EAP from traditional pre-release software. Please note that the quality of EAP versions may at times be way below even usual beta standards.

So use it at your own risk, but you may judge this a risk worth taking if you need the CMake debugging.

Tags:

Cmake

Clion