The little C kit
ISC License
The little C kit
bin/ckit
tool for building and testing projects (calls cmake & ninja)pkg/rbase
common functionality for C projects (optional to use)example/hello/
an example projectckit.cmake
CMake routinesQuick install: (see Installing for details and options)
git clone https://github.com/rsms/ckit.git ~/ckit
cat << EOF >> ~/`[[ $SHELL == *"/zsh" ]] && echo .zshrc || echo .bashrc`
export CKIT_DIR=\$HOME/ckit
export PATH=\$PATH:\$CKIT_DIR/bin
EOF
bin/ckit
This multitool provides a few convenience commands:
ckit build
or ckit
build project of current directoryckit test
build & run testsckit watch
build & run as sources files changeckit init
generate cmakelists.txt
file for a projectSee ckit -help
for details or have a look at an example project
ckit can be installed in two ways:
~/ckit
myproject/ckit
Example of ckit installed in a shared location:
git clone https://github.com/rsms/ckit.git ~/ckit
export CKIT_DIR=$HOME/ckit
export PATH=$PATH:$CKIT_DIR/bin
mkdir ~/myproject
cd ~/myproject
echo "int main() { return 0; }" > hello.c
ckit init # generate cmakelists.txt
ckit build # build all targets
./out/debug/myproject # run example program
ckit test # build & run tests
ckit watch -r myproject # build & run as sources change
Example of ckit as a subdirectory:
mkdir ~/myproject
cd ~/myproject
git clone https://github.com/rsms/ckit.git
echo "int main() { return 0; }" > hello.c
./ckit/bin/ckit init # generate cmakelists.txt
./ckit/bin/ckit build # build all targets
./out/debug/myproject # run example program
./ckit/bin/ckit test # build & run tests
./ckit/bin/ckit watch -r myproject # build & run as sources change
Dependencies:
Additionally, the ckit watch
command requires:
ninja -t deps
)Note that you don't have to use bin/ckit
.
ckit packages are plain CMake projects and thus you can just use CMake if you want.
Some CMake reading: