https://github.com/rvarago/modern-cmake-template
CMake template for an example project composed of executable and library
https://github.com/rvarago/modern-cmake-template
c cmake cmake-template cpp modern-cmake modern-cmake-template
Last synced: 3 months ago
JSON representation
CMake template for an example project composed of executable and library
- Host: GitHub
- URL: https://github.com/rvarago/modern-cmake-template
- Owner: rvarago
- License: gpl-3.0
- Created: 2018-08-19T12:26:05.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-21T09:08:47.000Z (almost 5 years ago)
- Last Synced: 2025-05-08T02:40:30.384Z (5 months ago)
- Topics: c, cmake, cmake-template, cpp, modern-cmake, modern-cmake-template
- Language: CMake
- Homepage:
- Size: 33.2 KB
- Stars: 65
- Watchers: 8
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Modern CMake Template
> Template for projects based on modern CMake practices.
Components:
- `app`.
- `libs/lib1`.
- `libs/lib1/tests`.See [How to Use Modern CMake for an App + Lib Project](https://rvarago.github.io/2018/08/20/how-to-use-modern-cmake-for-an-app-p-lib-project.html) for more information.
## Usage
Create the `build` directory and configure the build system:
```bash
cmake -B build # Or `cmake -D BUILD_TESTING=OFF -B build` to skip tests.
```Build the project:
```bash
cmake --build build
```Inspect the `build` directory to find the application and the tests.
Optionally, run the tests with `ctest` by typing:
```bash
cmake -E chdir build ctest
```