From 2498a5c0456697734ca323c25716e372f79105a9 Mon Sep 17 00:00:00 2001 From: karl Date: Wed, 20 Dec 2023 22:33:17 +0100 Subject: [PATCH] make cavacore an actual library with cmake #487 --- CAVACORE.md | 13 ++++++++++++- CMakeLists.txt | 6 ++++++ cavacore_test.c | 4 ++-- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100755 CMakeLists.txt diff --git a/CAVACORE.md b/CAVACORE.md index 8a52aab..8d6a535 100644 --- a/CAVACORE.md +++ b/CAVACORE.md @@ -40,6 +40,17 @@ This feature can be adjusted. The range of an input signal can vary a lot. cavacore can keep the output signal within range in real-time. This feature can be disabled. +# Building + +use the root CMakeLists.txt to build it: + +``` +mkdir build +cd build +cmake .. +cmake --build . +``` + # Usage -See cavacore.h for documentation and the cavacore_test.c application for how to use. \ No newline at end of file +See cavacore.h for documentation and the cavacore_test.c application for how to use. diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100755 index 0000000..a52d5c4 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +# This is only for the cavacore lib, see CAVACORE.md for details +# to build cava don't use this, use the automake stuff + +cmake_minimum_required(VERSION 3.13.0) +project(cavacore) +add_library(cavacore STATIC cavacore.c) diff --git a/cavacore_test.c b/cavacore_test.c index 709b9e7..2b16c7d 100644 --- a/cavacore_test.c +++ b/cavacore_test.c @@ -1,6 +1,6 @@ -// cavacore standalone test app, build cava first and compile with: +// cavacore standalone test app, build cavacore lib first and compile with: // gcc -c -g cavacore_test.c -// gcc -o cavacore_test cavacore_test.o cava-cavacore.o -lm -lfftw3 +// gcc -o cavacore_test cavacore_test.o build/libcavacore.a -lm -lfftw3 #include "cavacore.h" #include