Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I debug CMakeLists.txt files?

Tags:

cmake

Is there a possibility to debug CMakeLists.txt files (at least listing of variables) except for the message statement?

like image 280
Peter Avatar asked Apr 02 '14 06:04

Peter


People also ask

How do I debug CMakeLists?

You can also start a debug session from Solution Explorer. First, switch to CMake Targets View in the Solution Explorer window. Then, right-click on an executable and select Debug. This command automatically starts debugging the selected target based on your active configuration.

What is a CMakeLists txt file?

CMakeLists. txt file contains a set of directives and instructions describing the project's source files and targets (executable, library, or both). When you create a new project, CLion generates CMakeLists. txt file automatically and places it in the project root directory.

Where is CMakeLists TXT located?

CMakeLists. txt is placed at the root of the source tree of any application, library it will work for. If there are multiple modules, and each module can be compiled and built separately, CMakeLists. txt can be inserted into the sub folder.

How do you comment CMakeLists txt?

However, to comment several lines at once, select the required lines and hit CTRL + Q . If the file is a . txt file (e.g. CMakeLists. txt), you can either set Notepad++ to always treat .


1 Answers

There is no interactive debugger for CMake, however there are also the flags -Wdev, --debug-output and --trace which might help. Also remember to check the log files CMakeFiles\CMakeOutput.log and CMakeFiles\CMakeError.log which mainly collect outputs of processes called by CMake (for example while checking for presence of a type or header).

Since version 3.7, CMake now officially supports a "server mode" so integration in IDEs is likely to improve in the near future. Initial support exists both in Qt Creator and Visual Studio 2017 RC

like image 189
Joe Avatar answered Oct 21 '22 02:10

Joe