Template for a modern C++ project using CMake.
git clone --recurse-submodules https://github.com/rdong8/cpp_project.git
cd cpp_project/make system-depsFirst ensure you have pyenv and pyenv-virtualenv installed. Then:
make py-depsIf you haven't already, create a conan profile, which can be done with:
make conan-profileThen install the project's C++ dependencies with Conan:
make conan-depsEither run:
make cmake-configor 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 buildThe cpp_project executable will be in build/src/Debug/.
make runmake testmake docsThe documentation will be under build/docs/html/.
While developing, you may want to have some tasks automatically run with pre-commit.
make pre-commit