Simpler CMake project initializer script for C++ (with Conan).
There are many project initializer script for C++ with CMake, the most famous one is cmake-init. Unfortunately, it generates too much files for my liking. Looking at this issue, that has been up for 2 years, it seems that the author does not have the time to provide an option to generate a simpler, thinner, project structure. This script is an attempt to provide that.
cmakestrap is available from PyPI:
pip install --user cmakestrap
- Python 3.12+
- CMake 3.16+ (might need higher version for newer C++ features)
- Conan 2 (for dependency management)
This script provides a simple way to bootstrap a C++ project with CMake (build system) and Conan (dependency management). You can generate projects in 3 mode:
- Executable mode (default): generate a traditional C++ project structure with headers and such.
- Library mode: generate a header only library project (C++20).
- Modules mode: generate a CMake module project (requires CMake 3.28+ and supported compilers).
Initializing a simple hello world project:
cmakestrap hello
To see the available options, run the script with the
-hflag:
cmakestrap -h