How do I debug CMakeLists.txt files?

前端 未结 5 1398
既然无缘
既然无缘 2020-11-29 19:52

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

5条回答
  •  时光说笑
    2020-11-29 20:44

    Also, read about the env var VERBOSE: https://cmake.org/cmake/help/latest/envvar/VERBOSE.html

    I used it this way:

    export VERBOSE=defined
    make
    

    and got some more verbosity.

    In other cases, edit CMakeLists.txt file to include the following line:

    set(CMAKE_VERBOSE_MAKEFILE ON)
    

    (Some post on this is https://bytefreaks.net/programming-2/make-building-with-cmake-verbose ).

    Also, there are useful cmake options controlling debug output, see the manpage: https://cmake.org/cmake/help/latest/manual/cmake.1.html

提交回复
热议问题