/cpp-conan-template

C++ conan cmake project template

Primary LanguageCMake

CPP conan template

A template repo to quickly start cpp projects using conan package manager and CMake.

Inspired by ForgottenUmbrella's gist

Configure

  1. Change project name in CMakeList.txt.
  2. Update dependencies in conanfile.txt.

Setup

Run

./setup.sh

or

mkdir build && cd build
conan install ..
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=1 # generates compile_commands.json

ln -s compile_commands.json ../compile_commands.json # link compile_commands.json to home dir

Note: Omit ln -s ... for windows manually copy compile_commands (AFAIK ln is not supported on windows).

Compile

After file changes

cd build
make -jX

X: number of CPU threads on your machine

After dependencies changes

cd build
conan install ..
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=1

Binary

Binary/app can be found in build/bin/ which will be same as your project name.