Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidace/cmaketemplate
A template for building C++ projects using modern CMake with Conan integration
https://github.com/davidace/cmaketemplate
cmake conan cpp17 h5pp
Last synced: 4 months ago
JSON representation
A template for building C++ projects using modern CMake with Conan integration
- Host: GitHub
- URL: https://github.com/davidace/cmaketemplate
- Owner: DavidAce
- License: mit
- Created: 2019-10-05T09:21:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-20T14:56:25.000Z (8 months ago)
- Last Synced: 2024-10-09T19:23:04.237Z (4 months ago)
- Topics: cmake, conan, cpp17, h5pp
- Language: CMake
- Homepage:
- Size: 331 KB
- Stars: 18
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Ubuntu 22.04](https://github.com/DavidAce/CMakeTemplate/actions/workflows/ubuntu-22.04.yml/badge.svg)](https://github.com/DavidAce/CMakeTemplate/actions/workflows/ubuntu-22.04.yml)
# CMake Template
A template for building C++ projects using modern CMake with dependencies handled by Conan.## Features
- Unit testing with CTest
- Conan integration for dependencies## Requirements
- C++17 compiler. Tested with
- GNU GCC version 12,
- LLVM Clang version 15
- CMake version 3.24 or above.
- conan version 2 **(Recommended)**## Dependencies
By default, the direct dependencies are:
- [h5pp](https://github.com/DavidAce/h5pp) For fast and simple binary storage (includes hdf5, eigen, spdlog and fmt)
- [Eigen3](http://eigen.tuxfamily.org/) For linear algebra
- [fmt](https://github.com/fmtlib/fmt) For string formatting
- [spdlog](https://github.com/gabime/spdlog) For loggingThese dependencies are installed automatically when using the bundled CMake Presets `release-conan` or `debug-conan`.
Note that `h5pp` itself has the same dependencies, so they should already be present if `h5pp` was installed previously.
## Compatibility
This template has only been tested in Linux environments.## Usage with CMake Presets
Build as any regular out-of-source CMake project after installing the dependencies above.Use the bundled CMake Presets to opt-in to automatic dependency installation with conan.
#### Step 1: Install conan
pip install conan
conan profile detect#### Step 2: Clone CMakeTemplate and list its presets
Open a terminal and rungit clone https://github.com/DavidAce/CMakeTemplate.git
cd CMakeTemplate
cmake --list-presets
-------------------------------------------------------
> Available configure presets:
>
> "release-conan" - Release|conan package manager
> "debug-conan" - Debug|conan package manager#### Step 3: Configure and build
Select a preset listed in the previous step, and runcmake --preset=release-conan
cmake --build --preset=release-conanThese commands configure the project and builds the executable at `./build/release-conan/CMT`