This project is a C/C++ library built using Conan 2, featuring modern C and C++ standard support and module capabilities.
- Language: C/C++
- Library Build System: Python with Conan 2.0
- File Build System: Doxygen, Graphviz, Sphinx
- Module Support: Optionally activated, when C++ standard ≥ 23
- Component Structure:
- pairwise header and source assumption
- suffix distinguishment, (.h, .c) for C part, and (.hpp, .cpp) for C++ part
- documenting system uses .dox for pure docstring, .cxx for examples codes
- Conan-based modern dependency management
- Supports C++ standards 17, 20, and 23
- Automatic module file generation (
.ixx/.cppm) from headers/sources - Cross-platform compatibility (Windows, Linux, macOS)
- Dual C and C++ interfaces with separate linkage targets
- Doxygen annotation support for object exporting (
@exporter,@attacher) - Automation documenting system via Doxygen and Sphinx
- Importation, derivation and call relationship illustration through Graphviz
- Conan 2.0+
- Compatible C/C++ compiler:
- GCC
- Clang
- MSVC
- CMake
- Doxygen
- Graphviz
- sphinx
- sphinx-intl
- sphinx-rtd-theme
- GTest
inplace build and test
conan create . -s build_type=Debug --build=missingcross-build to host device (assume toolchain and profile are ready):
conan create . -pr:b=default -pr:h=arm_profile -s build_type=Debug --build=missing -tf=""python ./docs/build.pyUnix-like platforms (Linux, MacOS):
bash ./buildWindows:
Get-Content "build" | Invoke-ExpressionAdd your required libraries in conandata.yml where dependency graph is automatically computed from, then modify the dependencies field in metadata.json to config proper package names and associated targets to link (no need modification on CMakeLists.txt).
Requirements for your project can be the package archived on Conan Center, or user built ones. If the later one, at least you need a locale Conan server for managing your libraries.
project-root/
├── conanfile.py # Conan recipe
├── CMakeLists.txt # CMake build framework
├── metadata.json # Project metadata configuration (name, version, etc)
├── conandata.yml # Dependency specifications, Conan plugin support
├── LICENSE # Project license
├── include/ # Public headers
│ ├── *.h # C interface headers
│ └── *.hpp # C++ interface headers
├── src/ # Implementation files
│ ├── *.c # C sources
│ ├── *.cpp # C++ sources
│ └── *.ixx/*.cppm # Auto-generated Module files (in experimental)
├── docs/ # Documentations root
│ ├── doxygen/ # Doxygen system main root
│ │ ├── dox/ # Pure documentations' folder
│ │ │ ├── demos/ # Examples catelogue
│ │ │ │ ├── *.dox # Documenting docstring
│ │ │ │ └── *.cxx # Example codes
│ │ │ └── *.dox # Main pages and etc
│ │ └── ...
│ ├── sphinx/ # Sphinx system main root
│ │ ├── source/ # Source files of sphinx system
│ │ ├── locales/ # Pot files for internalization
│ │ └── ...
│ └── images/ # Static images for doxygen/sphinx system
└── test_pacakge/ # Test project
├── export/ # Log for testing results
├── stress/
│ └── *.cpp # Scripts for stress testing
├── unit/
│ └── *.cpp # Scripts for unit testing
├── main.cpp # Validation program for package
├── conanfile.py # Conan recipe for test_package
└── CMakeLists.txt # CMake build workflow for test_package
When generate_modules_inplace is enabled in metadata.json:
- Header/source pairs automatically generate module files
#includedirectives are converted toimportstatements- Doxygen annotations control symbol visibility:
@exporter: Exports symbols in modules@attacher: Attaches symbols to modules
This feature is experimental now, however, the specific syntax can make the existing project a ease migration to fit the future C++ standard.
| Feature | MSVC | Clang | GCC | Apple-Clang |
|---|---|---|---|---|
| C++ Modules | ✓ | ✓ | ✓ | ✓ |
| C Compatibility | ✓ | ✓ | ✓ | ✓ |
| Automatic Export | ✓ | ✓ | ✓ | ✓ |
- Desktop: Windows, Linux, MacOS
- Mobile: arm-linux, risc-v
Possible frame design/validation on Apple Clang compiler (raised from dlib requirement).
[Apache-2.0] - See included LICENSE file for details.