cmake_minimum_required(VERSION 3.24 FATAL_ERROR) project(dmf-studio VERSION 0.1.0 LANGUAGES CXX C) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) # All executables land in build/bin so studio-manager finds node binaries next to itself set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) # Homebrew on Apple Silicon if(APPLE) list(APPEND CMAKE_PREFIX_PATH /opt/homebrew) endif() include(FetchContent) # ── fmt (brew install fmt — already installed) ─────────────────────────────── find_package(fmt REQUIRED) # ── spdlog (brew install spdlog — just installed) ──────────────────────────── find_package(spdlog REQUIRED) # ── stduuid (header-only; no brew formula) ─────────────────────────────────── set(UUID_SYSTEM_GENERATOR ON CACHE BOOL "" FORCE) # use CoreFoundation on macOS set(UUID_USING_CXX20_SPAN ON CACHE BOOL "" FORCE) # std::span, no GSL dependency set(UUID_BUILD_TESTS OFF CACHE BOOL "" FORCE) FetchContent_Declare(stduuid GIT_REPOSITORY https://github.com/mariusbancila/stduuid.git GIT_TAG v1.2.3 ) FetchContent_MakeAvailable(stduuid) # ── picojson (single-header; no brew formula) ──────────────────────────────── FetchContent_Declare(picojson_fc GIT_REPOSITORY https://github.com/kazuho/picojson.git GIT_TAG v1.3.0 ) FetchContent_MakeAvailable(picojson_fc) # MXL includes and . # We replicate what Findpicojson.cmake would do — correctly including both dirs. set(_PICO_INC "${CMAKE_BINARY_DIR}/picojson-include") set(_PICO_WRAP "${CMAKE_BINARY_DIR}/picojson-wrapper") file(MAKE_DIRECTORY "${_PICO_INC}/picojson" "${_PICO_WRAP}/picojson") file(COPY "${picojson_fc_SOURCE_DIR}/picojson.h" DESTINATION "${_PICO_INC}/picojson/") file(WRITE "${_PICO_WRAP}/picojson/wrapper.h" "#pragma once\n" "#pragma GCC diagnostic push\n" "#pragma GCC diagnostic ignored \"-Wmaybe-uninitialized\"\n" "#include \n" "#pragma GCC diagnostic pop\n") add_library(picojson_impl INTERFACE) target_include_directories(picojson_impl INTERFACE "${_PICO_INC}" "${_PICO_WRAP}") add_library(picojson::picojson ALIAS picojson_impl) # ── MXL SDK ────────────────────────────────────────────────────────────────── # All four deps (fmt, spdlog, stduuid, picojson::picojson) are already targets, # so MXL's "if (NOT TARGET ...)" guards skip its find_package() calls. set(BUILD_TOOLS OFF CACHE BOOL "" FORCE) set(BUILD_TESTS OFF CACHE BOOL "" FORCE) set(BUILD_DOCS OFF CACHE BOOL "" FORCE) set(BUILD_UTILS OFF CACHE BOOL "" FORCE) add_subdirectory(mxl) # ── nlohmann/json (for our code) ───────────────────────────────────────────── FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz) FetchContent_MakeAvailable(json) # ── Shared utilities (Signal.hpp, NodeBase.hpp, FlowDef.hpp, V210.hpp) ─────── add_library(dmf-shared INTERFACE) target_include_directories(dmf-shared INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/shared) target_link_libraries(dmf-shared INTERFACE mxl nlohmann_json::nlohmann_json) add_subdirectory(nodes/testpattern) add_subdirectory(nodes/fakesink) add_subdirectory(studio-manager)