An OS-agnostic C++ library template using plain CMake for distribution, testing, and documentation.
How to export C++ library is a template project that helps developers package C++ code into reusable libraries using CMake. It solves the problem of complex library distribution by providing a cross-platform setup with built-in testing, documentation generation, and CI/CD support. The template handles platform-specific challenges like Windows DLL symbol exposure automatically.
C++ developers and library maintainers who need to create distributable libraries with minimal configuration. It's especially useful for those new to C++ library packaging or looking for a standardized, best-practice approach.
Developers choose this template because it provides a production-ready, OS-agnostic foundation that eliminates common pain points in C++ library distribution. Its plain CMake approach ensures portability while including essential features like testing, documentation, and CI integration out of the box.
An OS-agnostic C++ library template in plain CMake.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses plain CMake to create OS-agnostic libraries without platform-specific code, as highlighted in the README's overview for distribution.
Leverages CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS to automatically expose symbols for Windows DLLs, eliminating manual declspec annotations.
Includes ctest integration for adding and running unit tests, with examples in the test/CMakeLists.txt to ensure reliability.
Comes pre-configured with GitHub Actions scripts for continuous integration and automated builds, reducing setup time.
Provides a dedicated Doxygen target to automatically generate and install API documentation, as detailed in the doc/CMakeLists.txt.
Relies on YCM project files for features like RPATH support, adding complexity if not using YCM, as noted in the dependencies section.
Assumes familiarity with CMake; the README warns that new users might underestimate library maintenance complexities, requiring a learning curve.
Tied exclusively to CMake, making it unsuitable for projects using other build systems or requiring custom, non-standard packaging workflows.
Requires significant modification of CMake files, CI scripts, and licensing, which can be time-consuming for specific project needs.