Files
es5-clap/CMakeLists.txt
sub 4d0ad127b5 Add shared memory daemon architecture and systemd service
Move ES-5 encoding from the CLAP plugin to a standalone PipeWire
daemon (es5d) communicating via POSIX shared memory. The plugin now
acts as a parameter/state frontend while es5d outputs directly to
the ES-9. Includes systemd user service for autostart after reboot
and an install script for local deployment.
2026-03-27 22:01:04 +01:00

73 lines
2.1 KiB
CMake

cmake_minimum_required(VERSION 3.17)
project(es5-clap VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
include(FetchContent)
FetchContent_Declare(
clap
GIT_REPOSITORY https://github.com/free-audio/clap.git
GIT_TAG 1.2.7
)
FetchContent_MakeAvailable(clap)
FetchContent_Declare(
clap-helpers
GIT_REPOSITORY https://github.com/free-audio/clap-helpers.git
GIT_TAG main
)
FetchContent_MakeAvailable(clap-helpers)
add_library(${PROJECT_NAME} MODULE
src/plugin.cpp
src/entry.cpp
)
target_link_libraries(${PROJECT_NAME} PRIVATE clap-helpers)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set_target_properties(${PROJECT_NAME} PROPERTIES
PREFIX ""
SUFFIX ".clap"
)
target_link_options(${PROJECT_NAME} PRIVATE
-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/linux-es5-clap.version
-Wl,-z,defs
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set_target_properties(${PROJECT_NAME} PROPERTIES
BUNDLE TRUE
BUNDLE_EXTENSION clap
MACOSX_BUNDLE_GUI_IDENTIFIER at.sub-net.es5-clap
MACOSX_BUNDLE_BUNDLE_NAME "ES-5 Encoder"
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}"
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set_target_properties(${PROJECT_NAME} PROPERTIES
PREFIX ""
SUFFIX ".clap"
)
endif()
# ES-5 daemon (PipeWire output)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(PkgConfig REQUIRED)
pkg_check_modules(PIPEWIRE REQUIRED libpipewire-0.3)
add_executable(es5d tools/es5d.cpp)
target_include_directories(es5d PRIVATE ${PIPEWIRE_INCLUDE_DIRS})
target_link_libraries(es5d PRIVATE ${PIPEWIRE_LIBRARIES} rt)
target_compile_options(es5d PRIVATE ${PIPEWIRE_CFLAGS_OTHER})
endif()
# Install to standard CLAP paths
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib/clap)
install(TARGETS es5d RUNTIME DESTINATION bin)
install(FILES dist/es5d.service DESTINATION lib/systemd/user)
endif()