CppUtils is a collection of general purpose C++ libraries with no external dependencies. This repository is a superproject providing all the libraries CppUtils has to offer. Each one is individually usable, although some may depend on others.
Key benefits of this project structure I designed:
- Fulfills any CMake use case (namely, installation and local build use cases).
- Keeps dependencies isolated and accessible via
find_packagealong with FetchContent or ExternalProject. - Wrote automated tests with CTest, distributed products with CPack, and wrote reusable CMakePresets.
CppUtils
- CppUtils_Core (library)
- CppUtils_Misc (library)
- CppUtils_StdReimpl (library)
These projects are built together using FetchContent in CMake. This means they configure together (all from the same invocation of CMake), which makes debugging and development easier with the subprojects.
Built with CMake - cross-platform, standardized, and IDE-friendly.
We provide CMake presets, which handle feeding arguments to CMake for you.
Most IDEs provide built-in CMake integration.
Has the "CMake Tools" and "C/C++" extensions, both developed by Microsoft.
Has very nice integration, but they seem behind when it comes to supporting the latest CMake features. I've had experiences where I have to switch to VS Code because of this.
Command line: cmake --preset="win-debug-default".
IDE: Choose the win-debug-default configure preset, and "configure" the CMake project.
Command line: cmake --build --preset="win-debug".
IDE: Choose the win-debug build preset, and "build" it.
Here's how to run automated tests, to verify that our code behaves as intended.
See "Build Instructions" above.
Command line: ctest --preset="cpputils-win-debug".
IDE: Choose the cpputils-win-debug test preset, and "run tests".