Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 27 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 6d95ff0bbb1524b5846e4222f5dc610f9e8d0b7a)
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
# <godot-cpp-build>/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)
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
|---|---|---|
Expand Down
12 changes: 0 additions & 12 deletions dependencies.cmake

This file was deleted.

Loading