2026-09-06 20:46:08 -07:00
|
|
|
# streamer-tools OBS Camera Plugin - core library
|
|
|
|
|
#
|
|
|
|
|
# No OBS dependency by design (see docs/superpowers/specs/
|
|
|
|
|
# 2026-09-06-obs-camera-plugin-design.md in the streamer-tools repo) --
|
|
|
|
|
# this must build and test headlessly on every platform.
|
|
|
|
|
|
2026-09-06 21:28:55 -07:00
|
|
|
set(STPLUGIN_CORE_SOURCES
|
2026-09-06 20:46:08 -07:00
|
|
|
src/core.cpp
|
2026-09-06 21:28:55 -07:00
|
|
|
src/json.cpp
|
|
|
|
|
src/http_common.cpp
|
|
|
|
|
src/api_client.cpp
|
2026-09-06 21:39:49 -07:00
|
|
|
src/session_types.cpp
|
|
|
|
|
src/session.cpp
|
2026-09-06 20:46:08 -07:00
|
|
|
)
|
|
|
|
|
|
2026-09-06 21:28:55 -07:00
|
|
|
# HTTP backend, one per platform. See core/include/stplugin/http.h for why
|
|
|
|
|
# this is split rather than using libcurl everywhere.
|
|
|
|
|
if(WIN32)
|
|
|
|
|
list(APPEND STPLUGIN_CORE_SOURCES src/http_winhttp.cpp)
|
|
|
|
|
else()
|
|
|
|
|
list(APPEND STPLUGIN_CORE_SOURCES src/http_curl.cpp)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_library(stplugin_core STATIC ${STPLUGIN_CORE_SOURCES})
|
|
|
|
|
|
2026-09-06 20:46:08 -07:00
|
|
|
target_include_directories(stplugin_core
|
|
|
|
|
PUBLIC
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
|
|
|
)
|
|
|
|
|
|
2026-09-06 21:22:14 -07:00
|
|
|
target_link_libraries(stplugin_core
|
|
|
|
|
PUBLIC
|
|
|
|
|
LiveKit::livekit
|
|
|
|
|
)
|
|
|
|
|
|
2026-09-06 21:28:55 -07:00
|
|
|
if(WIN32)
|
|
|
|
|
target_link_libraries(stplugin_core PRIVATE winhttp)
|
|
|
|
|
else()
|
|
|
|
|
find_package(CURL REQUIRED)
|
|
|
|
|
target_link_libraries(stplugin_core PRIVATE CURL::libcurl)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
target_link_libraries(stplugin_core PUBLIC Threads::Threads)
|
|
|
|
|
|
2026-09-06 20:46:08 -07:00
|
|
|
set_target_properties(stplugin_core PROPERTIES
|
|
|
|
|
POSITION_INDEPENDENT_CODE ON
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
add_subdirectory(tests)
|