Template for a modern C++ project using CMake.
git clone --recurse-submodules https://github.com/rdong8/cpp_project.git
cd cpp_project/
make system-deps
First ensure you have pyenv and pyenv-virtualenv installed. Then:
make py-deps
If you haven't already, create a conan profile, which can be done with:
make conan-profile
Then install the project's C++ dependencies with Conan:
make conan-deps
Either run:
make cmake-config
or create a CMake profile in CLion with the following settings:
- Name: Debug
- Build type: Debug
- Toolchain: Use Default
- Generator: Ninja Multi-Config
- CMake options:
-G "Ninja Multi-Config" -DCMAKE_TOOLCHAIN_FILE=build/Debug/generators/conan_toolchain.cmake
- Build directory:
build/
- Build options: empty
- Environment: empty
make build
The cpp_project
executable will be in build/src/Debug/
.
make run
make test
make docs
The documentation will be under build/docs/html/
.
While developing, you may want to have some tasks automatically run with pre-commit.
make pre-commit