### CMake configuration for zynaudioplayer library Source: https://github.com/zynthian/zynthian-ui/blob/vangelis/zynlibs/zynaudioplayer/CMakeLists.txt Builds the zynaudioplayer shared library from player.c, linking against jack, sndfile, pthread, samplerate, and rubberband. Enables -Wall and optionally -Werror via the ZYNAUDIOPLAYER_WERROR option (default ON). Installs the library to lib. ```cmake cmake_minimum_required(VERSION 3.20) # set(CMAKE_VERBOSE_MAKEFILE ON) project(zynaudioplayer) include(CheckIncludeFiles) include(CheckLibraryExists) link_directories(/usr/local/lib) add_library(zynaudioplayer SHARED player.c) option(ZYNAUDIOPLAYER_WERROR "Treat compiler warnings as errors" ON) target_compile_options(zynaudioplayer PRIVATE -Wall) if(ZYNAUDIOPLAYER_WERROR) target_compile_options(zynaudioplayer PRIVATE -Werror) endif() target_link_libraries(zynaudioplayer jack sndfile pthread samplerate rubberband) install(TARGETS zynaudioplayer LIBRARY DESTINATION lib) ``` -------------------------------- ### CMake configuration for zynsmf library Source: https://github.com/zynthian/zynthian-ui/blob/vangelis/zynlibs/zynsmf/CMakeLists.txt Builds the zynsmf shared library from zynsmf.cpp, event.cpp, track.cpp, and smf.cpp. Requires CMake 3.20 or later and links against the jack library. Installs the built library to the lib destination. ```cmake cmake_minimum_required(VERSION 3.20) # set(CMAKE_VERBOSE_MAKEFILE ON) project(zynsmf) include(CheckIncludeFiles) include(CheckLibraryExists) link_directories(/usr/local/lib) add_library(zynsmf SHARED zynsmf.cpp event.cpp track.cpp smf.cpp) add_definitions(-Werror) target_compile_options(zynsmf PRIVATE -Wmisleading-indentation) target_link_libraries(zynsmf jack) install(TARGETS zynsmf LIBRARY DESTINATION lib) ``` -------------------------------- ### CMake configuration for zynseq library Source: https://github.com/zynthian/zynthian-ui/blob/vangelis/zynlibs/zynseq/CMakeLists.txt Builds the zynseq shared library with optional mimalloc support. Requires CMake 3.20 and links against jack. If mimalloc is found, defines HAS_MIMALLOC and links it; otherwise falls back to the default system allocator. Installs the library to lib. ```cmake cmake_minimum_required(VERSION 3.20) project(zynseq) include(CheckIncludeFiles) include(CheckLibraryExists) find_package(mimalloc QUIET) link_directories(/usr/local/lib) set (CMAKE_BUILD_TYPE Debug) add_library(zynseq SHARED zynseq.h zynseq.cpp sequencemanager.cpp pattern.cpp sequence.cpp timebase.cpp track.cpp) add_definitions(-Werror) target_compile_options(zynseq PRIVATE -Wmisleading-indentation) if(mimalloc_FOUND) # Defines HAS_MIMALLOC so you can use #ifdef HAS_MIMALLOC in your C++ code target_compile_definitions(zynseq PRIVATE HAS_MIMALLOC) target_link_libraries(zynseq jack mimalloc) message(STATUS "mimalloc found and enabled for zynseq") else() target_link_libraries(zynseq jack) message(STATUS "mimalloc NOT found; falling back to default system allocator") endif() install(TARGETS zynseq LIBRARY DESTINATION lib) ``` -------------------------------- ### CMakeLists.txt for zynclippy shared library Source: https://github.com/zynthian/zynthian-ui/blob/vangelis/zynlibs/zynclippy/CMakeLists.txt Builds the zynclippy shared library from clippy.c, linking against jack, sndfile, samplerate, and rubberband. Enables -Werror and -Wmisleading-indentation, adds /usr/local/lib to the linker search path, and installs the library to lib. ```cmake cmake_minimum_required(VERSION 3.20) project(zynclippy) include(CheckIncludeFiles) include(CheckLibraryExists) link_directories(/usr/local/lib) add_library(zynclippy SHARED clippy.c) add_definitions(-Werror) target_compile_options(zynclippy PRIVATE -Wmisleading-indentation) target_link_libraries(zynclippy jack sndfile samplerate rubberband) install(TARGETS zynclippy LIBRARY DESTINATION lib) ``` -------------------------------- ### CMake build configuration for zynmixer Source: https://github.com/zynthian/zynthian-ui/blob/vangelis/zynlibs/zynmixer/CMakeLists.txt Defines the zynmixer shared library and its mixbus variant, linking against JACK and enabling strict compiler warnings. The mixbus target is built with the MIXBUS macro defined. ```cmake cmake_minimum_required(VERSION 3.20) project(zynmixer) include(CheckIncludeFiles) include(CheckLibraryExists) link_directories(/usr/local/lib) add_library(zynmixer SHARED mixer.h mixer.c) add_library(zynmixer_mixbus SHARED mixer.h mixer.c) add_definitions(-Werror) target_compile_options(zynmixer PRIVATE -Wmisleading-indentation) target_link_libraries(zynmixer jack) target_link_libraries(zynmixer_mixbus jack) target_compile_definitions(zynmixer_mixbus PUBLIC -D MIXBUS) install(TARGETS zynmixer LIBRARY DESTINATION lib) ```