CForge is a collection of CMake scripts and modules to forge robust and toolable build systems. Checkout the full CForge documentation on ReadTheDocs.
- CForgeAssert β Provide a simple assertion mechanism
- [Not yet implemented] CForgeConan β Integrate the Conan package manager into a CMake project
- [Not yet implemented] CForgeDoc β Generate rst-formatted documentation using Sphinx
- [Not yet implemented] CForgeFetchFmt β Fetch the Fmt library using FetchContent
- [Not yet implemented] CForgeFetchGoogleTest β Fetch the GoogleTest framework using FetchContent
- [Not yet implemented] CForgeFetchSpdlog β Fetch the Spdlog library using FetchContent
- CForgeForceColoredOutput β Force some compilers to always produce ANSI-colored output
- [Work in progress] CForgeJSON β Provide helper functions to parse JSON content
- [Not yet implemented] CForgeOption β Provide a flexible way to declare project-wide options
- [Not yet implemented] CForgeTargetAddPrecompiledHeaders β Add precompiled headers to a target
- CForgeTargetAddWarnings β Add warnings to a target from a dedicated CMake configuration file
- [Not yet implemented] CForgeTargetEnableCoverage β Enable test coverage analysis for a target
- [Not yet implemented] CForgeTargetEnableLTO β Enable Link-Time Optimizations for a target
- CForgeTargetEnableSanitizers β Enable sanitizers for a target
- [Not yet implemented] CForgeTargetEnableStaticAnalyzers β Enable static analysis for a target
- [Missing doc] CForgeUnit β Provide a unit-test and test coverage framework for CMake code
- FindGDB β Find the GDB executable for the current toolchain
- FindLCOV β Find the LCOV code coverage report generation tool
- FindOpenOCD β Find the OpenOCD executable
- FindSphinx β Find the Sphinx documentation generator
- [Not yet implemented] Stm32Gcc β A GCC-based toolchain for STM32 targets based on ObKo/stm32-cmake
There are multiple ways to integrate CForge into a CMake project:
- CForgeConfig.cmake β Install CForge into your system and use find_package(CForge) to locate it
- FetchContent β Use CMake's FetchContent module to download CForge and include it to your project
- Manual add_subdirectory β Manually add CForge to your project (eg. by copying the sources or as a git-submodule) and use add_subdirectory() to include it
Requirements depend on:
- how CForge is used (see Integration above),
- which CForge modules are used.
To build and install CForge, or to use CForge using add_subdirectory() or FetchContent, CMake 3.21+ is required. Other dependencies might be needed depending on the build options and modules used.
CForge modules installed and used through CForgeConfig.cmake might require a different CMake version (minimum required version for some modules can be lesser or greater than 3.21) and additional software requirements might be needed.
Check the modules documentation for further information.
- CFORGE_ENABLE_TESTING β Build the unit tests (default: ON)
- CFORGE_ENABLE_TESTING_AT_CONF β Run CForge test suite at configuration instead of during CTest phase (default: OFF, needs CFORGE_ENABLE_TESTING=ON)
- [Not yet implemented] CFORGE_ENABLE_FUZZING β Build the fuzzy tests (default: OFF, needs CFORGE_ENABLE_TESTING=ON)
- CFORGE_ENABLE_COVERAGE β Build with test coverage analysis (default: OFF, needs CFORGE_ENABLE_TESTING=ON)
- CFORGE_ENABLE_DOCUMENTATION β Generate the html documentation using Sphinx (default: OFF)
- [Not yet implemented] CFORGE_ENABLE_MIN_VERSION_CHECK β Add tests checking if the CMake minimum required versions are correctly set in CForge modules, using cmake_min_version (default: OFF, needs CFORGE_ENABLE_TESTING=ON)
If you want to get involved and suggest some additional features, signal a bug or submit a patch, please create a pull request or open an issue on the CForge Github repository.
Please follow the guidelines in CONTRIBUTING.md.