From 83a8acfd2c25d9fc7b05e923b57b5f050cc68faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Tue, 9 Jun 2026 07:18:47 -0400 Subject: [PATCH 1/2] cmake: migrate to find_package(Avendish) + avnd_addon_* (builds as score addon or standalone) --- CMakeLists.txt | 51 ++++++++++++++++++++++++---------------------- README.md | 6 ++++-- dependencies.cmake | 12 ----------- 3 files changed, 31 insertions(+), 38 deletions(-) delete mode 100644 dependencies.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index bfaa4f5..9025fdf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,31 +1,34 @@ -cmake_minimum_required(VERSION 3.13 FATAL_ERROR) +cmake_minimum_required(VERSION 3.24 FATAL_ERROR) project(MyData CXX) -include(dependencies.cmake) +# Use the Avendish the host already provides (e.g. ossia score); otherwise fetch it. +# The same CMakeLists builds this as an ossia/score add-on or as a standalone object. +find_package(Avendish QUIET) +if(NOT Avendish_FOUND) + include(FetchContent) + FetchContent_Declare( + Avendish + GIT_REPOSITORY "https://github.com/celtera/avendish" + GIT_TAG 49ba4e491e3ac1c9c775bdc911749f6328fa8b52) + FetchContent_Populate(Avendish) + list(APPEND CMAKE_PREFIX_PATH "${avendish_SOURCE_DIR}") + find_package(Avendish REQUIRED) +endif() -add_library(MyDataProcessor STATIC - src/Model.cpp - src/Model.hpp - src/Processor.hpp -) +avnd_addon_init(NAME MyData) -# avnd_make_object instantiates the data / message back-ends (no audio plug-in -# formats): ossia, Max/MSP, Pure Data, Python, TouchDesigner (CHOP message), Godot. -# Back-ends whose SDK is not found are silently skipped. -avnd_make_object( - TARGET MyDataProcessor - MAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/Processor.hpp" - MAIN_CLASS MyDataProcessor +# CATEGORY object: the data / message back-ends (no audio plug-in formats) -- ossia, +# Max/MSP, Pure Data, Python, TouchDesigner (CHOP message), Godot. In a score build only +# the ossia process is produced. Back-ends whose SDK is absent are silently skipped. +avnd_addon_object( + BASE MyData C_NAME my_data_processor -) + CLASS MyDataProcessor + MAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/Processor.hpp" + SOURCES + src/Model.cpp + src/Model.hpp + src/Processor.hpp) -# Workaround: when godot-cpp is pulled in via FetchContent, its only targets are -# `godot-cpp` (+ alias `godot::cpp`) — there is no `godot-cpp::godot-cpp`. Avendish's -# avnd_make_godot doesn't always resolve the target, so the generated headers under -# /gen/include never make it onto the GDExtension's include path and -# compilation fails with "godot_cpp/classes/node.hpp not found". Re-linking the target -# here (at a scope where it is visible) propagates godot-cpp's PUBLIC include dirs. -if(TARGET MyDataProcessor_NODE_godot AND TARGET godot-cpp) - target_link_libraries(MyDataProcessor_NODE_godot PRIVATE godot-cpp) -endif() +avnd_addon_finalize(NAME MyData UUID d589bb28-5055-4758-9236-00747b31a41d VERSION 1.0.0) diff --git a/README.md b/README.md index a0581cb..ca1f680 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,10 @@ It is the message-processing counterpart of the ## What gets built -The `avnd_make_object(...)` macro in `CMakeLists.txt` instantiates the object back-ends — -deliberately **not** the audio plug-in formats (VST3 / CLAP / …): +The `avnd_addon_object(... CATEGORY object)` call in `CMakeLists.txt` instantiates the +object back-ends — deliberately **not** the audio plug-in formats (VST3 / CLAP / …). +The same `CMakeLists.txt` also builds as an ossia/score add-on (ossia back-end only) when +dropped into score, because it resolves Avendish via `find_package(Avendish)`: | Back-end | Object kind | SDK required | |---|---|---| diff --git a/dependencies.cmake b/dependencies.cmake deleted file mode 100644 index 7deb370..0000000 --- a/dependencies.cmake +++ /dev/null @@ -1,12 +0,0 @@ -include(FetchContent) - -FetchContent_Declare( - avendish - GIT_REPOSITORY "https://github.com/celtera/avendish" - GIT_TAG d08f0d7ca0ffed9e7d0186d51287f863be733e02 - GIT_PROGRESS true -) -FetchContent_Populate(avendish) - -set(CMAKE_PREFIX_PATH "${avendish_SOURCE_DIR};${CMAKE_PREFIX_PATH}") -find_package(Avendish REQUIRED) From 8c26fa75b4f910f87dfeb83410534826ab757358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Thu, 11 Jun 2026 17:43:34 -0400 Subject: [PATCH 2/2] cmake: bump avendish pin --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9025fdf..ce86849 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT Avendish_FOUND) FetchContent_Declare( Avendish GIT_REPOSITORY "https://github.com/celtera/avendish" - GIT_TAG 49ba4e491e3ac1c9c775bdc911749f6328fa8b52) + GIT_TAG 6d95ff0bbb1524b5846e4222f5dc610f9e8d0b7a) FetchContent_Populate(Avendish) list(APPEND CMAKE_PREFIX_PATH "${avendish_SOURCE_DIR}") find_package(Avendish REQUIRED)