Skip to content

CMake build automation utility

Zeioth edited this page Nov 11, 2023 · 7 revisions

When compiler.nvim detects a CMakeLists.txt file in the current working directory, Telescope will be populated with all its add_executable and add_custom_target entries.

When you open the compiler you will see the option to run it screenshot_2023-11-02_00-00-12_901709390

And this is the result screenshot_2023-11-02_01-40-02_298225055

In the same way you can run hello world, you can execute any command necessary to build your program.

More info

(optionally) You can define the next globals

global defaut value
CMAKE_BUILD_DIR ./build
CMAKE_BUILD_TYPE Debug
CMAKE_CLEAN_FIRST false

Example:

let g:CMAKE_BUILD_TYPE='Release'

Globals persist between Neovim sessions.