Skip to content

Minimal cmake boilerplate to be used with emacs projectile and lsp modes

Notifications You must be signed in to change notification settings

darkodraskovic/cmake_cpp_boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimal cmake boilerplate

Install clangd.

Linux

Configure and build

mkdir build folder. cd into build folder and run

cmake ..
make

Run

To run program

cd bin
./main

Generate compile_commands.json

compile_commands.json will be created in build directory. Symlink it (or simply copy it) to the root directory. To symlink it, cd to the root and

ln -s build/compile_commands.json.

Windows

We use bash environment with native CMake and Ninja. We build and compile with MSBuild and MSVC toolchain.

Configure

cd build/ && cmake ..

Build

cd build && MSBuild.exe -target:Build /property:Configuration=Release .\boilerplate.sln

Run

cd bin && main.exe

Generate compile_commands.json

cd ninja && cmake -G"Ninja" .. && mv compile_commands.json ..

About

Minimal cmake boilerplate to be used with emacs projectile and lsp modes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages