-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Minimal CMake
By :

This section covers an assortment of useful tools and features closely related to Visual Studio Code and CMake that can make development easier and may come in useful while working on future projects.
The first is a useful extension that provides syntax highlighting in CMakeLists.txt
and .cmake
files. The extension is simply called CMake, and its ID is twxs.cmake
. It can either be downloaded from https://marketplace.visualstudio.com/items?itemName=twxs.cmake, or from within the Visual Studio Code extension manager in the sidebar. It not only provides syntax highlighting but also useful snippets and completions.
When using either Ninja or Make generators, a cache variable can be provided to CMake called CMAKE_EXPORT_COMPILE_COMMANDS
to enable the generation of a file called compile_commands.json
. CMAKE_EXPORT_COMPILE_COMMANDS
can be added to a CMake preset or it can be passed at the command line...