https://github.com/thilinarmtb/ttt
Template for a CMake based C project (a library and a binary which calls it).
https://github.com/thilinarmtb/ttt
c clang-format clang-tidy cmake conda doxygen sphinx template
Last synced: about 1 year ago
JSON representation
Template for a CMake based C project (a library and a binary which calls it).
- Host: GitHub
- URL: https://github.com/thilinarmtb/ttt
- Owner: thilinarmtb
- Created: 2023-05-27T01:24:33.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-23T21:35:42.000Z (over 1 year ago)
- Last Synced: 2025-04-21T16:50:14.795Z (about 1 year ago)
- Topics: c, clang-format, clang-tidy, cmake, conda, doxygen, sphinx, template
- Language: C
- Homepage: https://thilinarmtb.github.io/ttt
- Size: 3.09 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TTT
`TTT` is a template for a CMake based C project to help easily bootstrap C
projects. This started as an effort to put all boilerplate code that I ended
up writing whenever I created a new project.
## Setup a new project
Simply use `setup.sh` to replace instances of `ttt` and `TTT` with your
project specific names and/or prefixes. This script also renames the files.
```sh
./setup.sh -rename mylib
```
Then `mylib` (Initially `ttt` before calling setup), can be used to
build and install the library `mylib.so` and the tests.
If the option `-n` or `-nuke` is also passed to the script, `setup.sh`
self-deletes itself, deletes git history and this `README.md` as well.
```sh
./setup.sh -rename mylib -nuke
```
Use `-h` or `-help` to print the full help message.
```sh
./setup.sh -help
```
## Build this project
This project uses conda to manage dependencies (CMake, clang-format, clang-tidy
and other dependencies for documentation). Dependencies can be installed by
executing following commands after installing
[conda](https://docs.conda.io/en/latest/miniconda.html).
```sh
conda env create -f environment-dev.yml
conda activate mylib-dev
```
You can format the source code with `clang-format` (`.c` and `.h` files are
likely to be messy after renaming from `ttt` to `mylib`) using the option
`-format`.
```
./mylibcfg
./mylib -format
```
Then you can initialize git, add the files and do the initial commit for the
new project.
```sh
git init
git add .
git commit
```
Simply run `mylibcfg` to configure and `mylib` script to build and install the
library.
```sh
./mylibcfg -enable-docs
./mylib -docs -install
```
Use `-help` to see all the options supported by `mylibcfg` and `mylib` script.
```
./mylibcfg -help
./mylib -help
```