Two more findings from the three-platform run, both from reading the actual
CI logs rather than guessing.
macOS. libobs now builds, installs, and is FOUND by find_package -- and then
every consumer fails with:
IMPORTED_LOCATION or IMPORTED_IMPLIB not set for imported target
"OBS::libobs" configuration "Release".
Restricting --install to the libobs subdirectory (the previous commit's fix
for the obs-frontend-api install error) also loses the per-configuration
export file, so libobsTargets.cmake lands without its
libobsTargets-release.cmake sibling and the imported target has no location
for any configuration. The install therefore goes back to the whole build
tree, exactly as upstream does, with its exit code tolerated: it gets all the
way through libobs and only then trips over the install rule of a target this
build deliberately skips. If libobs genuinely did not install,
find_package(libobs) in the top-level CMakeLists is where that surfaces, with
a far better message than a half-installed tree.
Belt and braces, the top-level CMakeLists also picks up
obs-plugintemplate's CMAKE_MAP_IMPORTED_CONFIG_* fallbacks, so an imported
target exported under a different configuration name still resolves.
Windows. The sub-configure was re-entering obs-studio's OWN dependency
downloader with a corrupted architecture:
string sub-command JSON member 'hashes windows-x64,version=10.0.26100.0'
not found
Unable to download .../windows-deps-2023-11-03-x64,version=10.0.26100.0.zip
Upstream passes "-A x64,version=<Windows SDK>", and with a current CMake that
",version=" suffix comes back out verbatim in the sub-build's
CMAKE_VS_PLATFORM_NAME -- which obs-studio keys its release assets off. Plain
"-A x64" now. The Windows SDK is selected automatically anyway ("Selecting
Windows SDK version 10.0.26100.0" in the same log), and CMAKE_SYSTEM_VERSION
is passed explicitly.
The macOS job also lists the installed libobs export directory, so the next
run answers "which target files actually landed" from CI output instead of
inference.
Linux remains green and unaffected: ctest 6/6.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RL8abRmgFXkVASHkkqiJbE
100 lines
4.2 KiB
CMake
100 lines
4.2 KiB
CMake
cmake_minimum_required(VERSION 3.19)
|
|
|
|
project(obs-streamer-tools-plugin
|
|
VERSION 0.1.0
|
|
DESCRIPTION "OBS Studio source plugin for streamer-tools camera feeds"
|
|
LANGUAGES C CXX
|
|
)
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
|
endif()
|
|
|
|
enable_testing()
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/common")
|
|
|
|
# --- OBS SDK ---------------------------------------------------------------
|
|
# Linux gets libobs from the distribution (Ubuntu's libobs-dev ships real
|
|
# libobsConfig.cmake), and that path is left exactly as it was.
|
|
#
|
|
# macOS and Windows have no such package, so they use obs-plugintemplate's
|
|
# buildspec bootstrap, trimmed: it downloads the pinned obs-deps bundle and
|
|
# the pinned obs-studio source, then builds and installs just `libobs`. See
|
|
# buildspec.json for why the OBS pin is deliberately low, and
|
|
# cmake/common/buildspec_common.cmake for every change from upstream.
|
|
#
|
|
# STPLUGIN_BOOTSTRAP_OBS=OFF falls back to plain find_package(libobs), for a
|
|
# developer who already has an OBS SDK on their prefix path and does not want
|
|
# a from-source libobs build.
|
|
option(STPLUGIN_BOOTSTRAP_OBS "Download and build libobs from source (macOS/Windows)" ON)
|
|
|
|
# Fallbacks for imported targets that were exported under a different
|
|
# configuration name than the one being built, lifted from
|
|
# obs-plugintemplate's cmake/common/bootstrap.cmake. Without these, an
|
|
# imported libobs exported as (say) RelWithDebInfo fails a Release build with
|
|
# "IMPORTED_LOCATION or IMPORTED_IMPLIB not set for imported target
|
|
# OBS::libobs configuration Release".
|
|
set(CMAKE_MAP_IMPORTED_CONFIG_RELEASE Release RelWithDebInfo MinSizeRel None "")
|
|
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release MinSizeRel None "")
|
|
set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL MinSizeRel Release RelWithDebInfo None "")
|
|
set(CMAKE_MAP_IMPORTED_CONFIG_DEBUG Debug RelWithDebInfo Release MinSizeRel None "")
|
|
|
|
include(osconfig)
|
|
if(STPLUGIN_BOOTSTRAP_OBS AND (OS_MACOS OR OS_WINDOWS))
|
|
if(OS_MACOS)
|
|
# client-sdk-cpp ships single-arch dylibs, so this plugin is built for
|
|
# one architecture even though the libobs it links is universal.
|
|
if(NOT CMAKE_OSX_ARCHITECTURES)
|
|
set(CMAKE_OSX_ARCHITECTURES "${CMAKE_HOST_SYSTEM_PROCESSOR}" CACHE STRING "" FORCE)
|
|
endif()
|
|
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "13.0" CACHE STRING "" FORCE)
|
|
endif()
|
|
endif()
|
|
include(buildspec)
|
|
endif()
|
|
|
|
# --- LiveKit C++ client SDK -------------------------------------------------
|
|
# Pinned, prebuilt release of livekit/client-sdk-cpp, downloaded and unpacked
|
|
# by cmake/LiveKitSDK.cmake, then consumed through its own CMake package
|
|
# config as the LiveKit::livekit imported target. See the design doc's
|
|
# "Resolved (2026-09-07)" section: an exact pin, never "latest".
|
|
set(STPLUGIN_LIVEKIT_SDK_VERSION "1.10.1" CACHE STRING
|
|
"Pinned livekit/client-sdk-cpp release version")
|
|
set(STPLUGIN_LIVEKIT_SDK_TRIPLE "" CACHE STRING
|
|
"Override the client-sdk-cpp release triple (e.g. ubuntu-24.04-x64); empty = autodetect")
|
|
set(STPLUGIN_LIVEKIT_SDK_DIR "${CMAKE_BINARY_DIR}/_deps/livekit-sdk" CACHE PATH
|
|
"Directory the client-sdk-cpp release archive is extracted into (point at a persistent path to cache it across CI builds)")
|
|
|
|
include(LiveKitSDK)
|
|
if(STPLUGIN_LIVEKIT_SDK_TRIPLE)
|
|
livekit_sdk_setup(
|
|
VERSION "${STPLUGIN_LIVEKIT_SDK_VERSION}"
|
|
SDK_DIR "${STPLUGIN_LIVEKIT_SDK_DIR}"
|
|
TRIPLE "${STPLUGIN_LIVEKIT_SDK_TRIPLE}"
|
|
)
|
|
else()
|
|
livekit_sdk_setup(
|
|
VERSION "${STPLUGIN_LIVEKIT_SDK_VERSION}"
|
|
SDK_DIR "${STPLUGIN_LIVEKIT_SDK_DIR}"
|
|
)
|
|
endif()
|
|
find_package(LiveKit CONFIG REQUIRED)
|
|
|
|
add_subdirectory(core)
|
|
|
|
find_package(libobs QUIET)
|
|
if(libobs_FOUND)
|
|
message(STATUS "libobs found (${libobs_DIR}) -- building OBS adapter module")
|
|
add_subdirectory(obs-adapter)
|
|
else()
|
|
message(WARNING "libobs NOT found -- skipping OBS adapter module; core library still builds/tests")
|
|
endif()
|