plugins: Update platform selection for adding plugins to build tree

This commit is contained in:
PatTheMav 2024-04-13 20:04:04 +02:00 committed by Ryan Foster
parent 34f8abae1f
commit be09cfe242

View file

@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.22...3.25)
option(ENABLE_PLUGINS "Enable building OBS plugins" ON)
if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0)
if(NOT ENABLE_PLUGINS)
set_property(GLOBAL APPEND PROPERTY OBS_FEATURES_DISABLED "Plugin Support")
return()
@ -12,85 +11,69 @@ if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0)
set_property(GLOBAL APPEND PROPERTY OBS_FEATURES_ENABLED "Plugin Support")
macro(check_obs_browser)
if(NOT (OS_WINDOWS AND NOT CMAKE_GENERATOR_PLATFORM MATCHES "(Win32|x64)"))
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/obs-browser/cmake/macos/Info.plist.in")
add_subdirectory(obs-browser)
elseif(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/obs-browser/CMakeLists.txt")
if((OS_WINDOWS AND CMAKE_GENERATOR_PLATFORM MATCHES "(Win32|x64)")
OR OS_MACOS
OR OS_LINUX)
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/obs-browser/CMakeLists.txt")
message(FATAL_ERROR "Required submodule 'obs-browser' not available.")
else()
add_subdirectory(obs-browser)
endif()
else()
add_custom_target(obs-browser)
target_disable(obs-browser)
endif()
endmacro()
macro(check_obs_websocket)
if(OS_WINDOWS
OR OS_MACOS
OR OS_LINUX)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/obs-websocket/cmake/macos/Info.plist.in")
add_subdirectory(obs-websocket)
elseif(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/obs-websocket/CMakeLists.txt")
message(FATAL_ERROR "Required submodule 'obs-websocket' not available.")
endif()
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/obs-websocket/CMakeLists.txt")
message(FATAL_ERROR "Required submodule 'obs-websocket' not available.")
else()
add_subdirectory(obs-websocket)
endif()
endmacro()
# Add plugins in alphabetical order to retain order in IDE projects
add_subdirectory(aja)
if(OS_WINDOWS OR OS_MACOS)
add_subdirectory(coreaudio-encoder)
endif()
if(OS_WINDOWS
OR OS_MACOS
OR OS_LINUX)
add_subdirectory(decklink)
endif()
add_subdirectory(image-source)
if(OS_LINUX)
add_subdirectory(linux-alsa)
add_subdirectory(linux-capture)
add_subdirectory(linux-jack)
add_subdirectory(linux-pipewire)
add_subdirectory(linux-pulseaudio)
add_subdirectory(linux-v4l2)
endif()
if(OS_MACOS)
add_subdirectory(mac-avcapture)
add_subdirectory(mac-capture)
add_subdirectory(mac-syphon)
add_subdirectory(mac-videotoolbox)
add_subdirectory(mac-virtualcam)
endif()
add_obs_plugin(aja PLATFORMS WINDOWS MACOS LINUX WITH_MESSAGE)
add_obs_plugin(coreaudio-encoder PLATFORMS WINDOWS MACOS)
add_obs_plugin(decklink PLATFORMS WINDOWS MACOS LINUX WITH_MESSAGE)
add_obs_plugin(image-source)
add_obs_plugin(linux-alsa PLATFORMS LINUX FREEBSD OPENBSD)
add_obs_plugin(linux-capture PLATFORMS LINUX FREEBSD OPENBSD)
add_obs_plugin(linux-jack PLATFORMS LINUX FREEBSD OPENBSD)
add_obs_plugin(linux-pipewire PLATFORMS LINUX FREEBSD OPENBSD)
add_obs_plugin(linux-pulseaudio PLATFORMS LINUX FREEBSD OPENBSD)
add_obs_plugin(linux-v4l2 PLATFORMS LINUX FREEBSD OPENBSD)
add_obs_plugin(mac-avcapture PLATFORMS MACOS)
add_obs_plugin(mac-capture PLATFORMS MACOS)
add_obs_plugin(mac-syphon PLATFORMS MACOS)
add_obs_plugin(mac-videotoolbox PLATFORMS MACOS)
add_obs_plugin(mac-virtualcam PLATFORMS MACOS)
check_obs_browser()
add_subdirectory(obs-ffmpeg)
add_subdirectory(obs-filters)
add_subdirectory(obs-outputs)
if(OS_WINDOWS)
add_subdirectory(obs-qsv11)
add_subdirectory(obs-text)
endif()
add_subdirectory(obs-transitions)
if(OS_WINDOWS
OR OS_MACOS
OR OS_LINUX)
add_subdirectory(obs-vst)
endif()
add_subdirectory(obs-webrtc)
add_obs_plugin(obs-ffmpeg)
add_obs_plugin(obs-filters)
add_obs_plugin(obs-libfdk)
add_obs_plugin(obs-outputs)
add_obs_plugin(obs-qsv11 PLATFORMS WINDOWS LINUX)
add_obs_plugin(obs-text PLATFORMS WINDOWS)
add_obs_plugin(obs-transitions)
add_obs_plugin(obs-vst PLATFORMS WINDOWS MACOS LINUX WITH_MESSAGE)
add_obs_plugin(obs-webrtc)
check_obs_websocket()
add_subdirectory(obs-x264)
add_subdirectory(rtmp-services)
if(OS_LINUX)
add_subdirectory(sndio)
endif()
add_subdirectory(text-freetype2)
if(OS_WINDOWS
OR OS_MACOS
OR OS_LINUX)
add_subdirectory(vlc-video)
endif()
if(OS_WINDOWS)
add_subdirectory(win-capture)
add_subdirectory(win-dshow)
add_subdirectory(win-wasapi)
endif()
add_obs_plugin(obs-x264)
add_obs_plugin(oss-audio PLATFORMS FREEBSD OPENBSD)
add_obs_plugin(rtmp-services)
add_obs_plugin(sndio PLATFORMS LINUX FREEBSD OPENBSD)
add_obs_plugin(text-freetype2)
add_obs_plugin(vlc-video WITH_MESSAGE)
add_obs_plugin(win-capture PLATFORMS WINDOWS)
add_obs_plugin(win-dshow PLATFORMS WINDOWS)
add_obs_plugin(win-wasapi PLATFORMS WINDOWS)
return()
endif()