2023-03-26 03:55:25 +02:00
|
|
|
cmake_minimum_required(VERSION 3.16...3.25)
|
|
|
|
|
|
|
|
legacy_check()
|
|
|
|
|
2022-03-16 23:11:58 +01:00
|
|
|
add_subdirectory(obs-frontend-api)
|
2014-01-20 16:58:58 +01:00
|
|
|
|
2022-03-16 23:11:58 +01:00
|
|
|
option(ENABLE_UI "Enable building with UI (requires Qt)" ON)
|
2023-03-26 03:55:25 +02:00
|
|
|
|
2022-03-16 23:11:58 +01:00
|
|
|
if(NOT ENABLE_UI)
|
2023-03-26 03:55:25 +02:00
|
|
|
target_disable_feature(obs "User Interface")
|
2022-03-16 23:11:58 +01:00
|
|
|
return()
|
|
|
|
else()
|
2023-03-26 03:55:25 +02:00
|
|
|
target_enable_feature(obs "User Interface")
|
2021-06-28 00:30:00 +02:00
|
|
|
endif()
|
|
|
|
|
2017-03-26 21:39:59 +02:00
|
|
|
find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil avformat)
|
2022-03-16 23:11:58 +01:00
|
|
|
find_package(CURL REQUIRED)
|
2014-09-15 23:20:43 +02:00
|
|
|
|
2023-03-26 03:55:25 +02:00
|
|
|
if(NOT TARGET OBS::libff-util)
|
|
|
|
add_subdirectory("${CMAKE_SOURCE_DIR}/deps/libff" "${CMAKE_BINARY_DIR}/deps/libff")
|
|
|
|
endif()
|
2022-03-16 23:11:58 +01:00
|
|
|
|
2023-03-26 03:55:25 +02:00
|
|
|
if(NOT TARGET OBS::json11)
|
|
|
|
add_subdirectory("${CMAKE_SOURCE_DIR}/deps/json11" "${CMAKE_BINARY_DIR}/deps/json11")
|
|
|
|
endif()
|
2022-03-16 23:11:58 +01:00
|
|
|
|
2023-03-26 03:55:25 +02:00
|
|
|
add_executable(obs-studio)
|
|
|
|
add_executable(OBS::studio ALIAS obs-studio)
|
2022-03-16 23:11:58 +01:00
|
|
|
|
2023-03-26 03:55:25 +02:00
|
|
|
target_link_libraries(
|
|
|
|
obs-studio
|
|
|
|
PRIVATE CURL::libcurl
|
|
|
|
FFmpeg::avcodec
|
|
|
|
FFmpeg::avutil
|
|
|
|
FFmpeg::avformat
|
|
|
|
OBS::libobs
|
|
|
|
OBS::frontend-api
|
|
|
|
OBS::libff-util
|
|
|
|
OBS::json11)
|
|
|
|
|
|
|
|
include(cmake/ui-qt.cmake)
|
|
|
|
include(cmake/ui-elements.cmake)
|
|
|
|
include(cmake/ui-windows.cmake)
|
|
|
|
include(cmake/feature-importers.cmake)
|
|
|
|
include(cmake/feature-browserpanels.cmake)
|
|
|
|
|
|
|
|
if(NOT OAUTH_BASE_URL)
|
2023-03-28 19:50:59 +02:00
|
|
|
# cmake-format: off
|
|
|
|
set(OAUTH_BASE_URL "https://auth.obsproject.com/" CACHE STRING "Default OAuth base URL")
|
2023-03-26 03:55:25 +02:00
|
|
|
mark_as_advanced(OAUTH_BASE_URL)
|
2023-03-28 19:50:59 +02:00
|
|
|
# cmake-format: on
|
2023-02-06 14:37:22 +01:00
|
|
|
endif()
|
2023-03-26 03:55:25 +02:00
|
|
|
include(cmake/feature-twitch.cmake)
|
|
|
|
include(cmake/feature-restream.cmake)
|
|
|
|
include(cmake/feature-youtube.cmake)
|
2023-04-27 09:39:50 +02:00
|
|
|
include(cmake/feature-sparkle.cmake)
|
2023-03-26 03:55:25 +02:00
|
|
|
include(cmake/feature-whatsnew.cmake)
|
2023-02-06 14:37:22 +01:00
|
|
|
|
2023-03-26 03:55:25 +02:00
|
|
|
add_subdirectory(frontend-plugins)
|
2022-03-16 23:11:58 +01:00
|
|
|
|
2023-03-26 03:55:25 +02:00
|
|
|
configure_file(ui-config.h.in ui-config.h)
|
2022-03-16 23:11:58 +01:00
|
|
|
|
|
|
|
target_sources(
|
2023-03-26 03:55:25 +02:00
|
|
|
obs-studio
|
2023-03-30 20:04:30 +02:00
|
|
|
PRIVATE # cmake-format: sortable
|
|
|
|
api-interface.cpp
|
2023-03-26 03:55:25 +02:00
|
|
|
auth-base.cpp
|
|
|
|
auth-base.hpp
|
2022-03-16 23:11:58 +01:00
|
|
|
auth-listener.cpp
|
|
|
|
auth-listener.hpp
|
2023-03-26 03:55:25 +02:00
|
|
|
auth-oauth.cpp
|
|
|
|
auth-oauth.hpp
|
|
|
|
display-helpers.hpp
|
|
|
|
multiview.cpp
|
|
|
|
multiview.hpp
|
2022-03-16 23:11:58 +01:00
|
|
|
obf.c
|
|
|
|
obf.h
|
|
|
|
obs-app.cpp
|
|
|
|
obs-app.hpp
|
|
|
|
obs-proxy-style.cpp
|
|
|
|
obs-proxy-style.hpp
|
|
|
|
platform.hpp
|
|
|
|
qt-display.cpp
|
|
|
|
qt-display.hpp
|
|
|
|
qt-wrappers.cpp
|
|
|
|
qt-wrappers.hpp
|
2023-03-26 03:55:25 +02:00
|
|
|
ui-config.h
|
2022-03-16 23:11:58 +01:00
|
|
|
ui-validation.cpp
|
2023-03-26 03:55:25 +02:00
|
|
|
ui-validation.hpp)
|
2014-02-02 15:16:40 +01:00
|
|
|
|
2022-03-16 23:11:58 +01:00
|
|
|
if(OS_WINDOWS)
|
2023-03-26 03:55:25 +02:00
|
|
|
include(cmake/os-windows.cmake)
|
2022-03-16 23:11:58 +01:00
|
|
|
elseif(OS_MACOS)
|
2023-03-26 03:55:25 +02:00
|
|
|
include(cmake/os-macos.cmake)
|
|
|
|
elseif(OS_LINUX)
|
|
|
|
include(cmake/os-linux.cmake)
|
|
|
|
elseif(OS_FREEBSD)
|
|
|
|
include(cmake/os-freebsd.cmake)
|
|
|
|
endif()
|
2022-03-16 23:11:58 +01:00
|
|
|
|
2023-03-26 03:55:25 +02:00
|
|
|
foreach(graphics_library IN ITEMS opengl metal d3d11)
|
|
|
|
string(TOUPPER ${graphics_library} graphics_library_U)
|
|
|
|
if(TARGET OBS::libobs-${graphics_library})
|
|
|
|
target_compile_definitions(obs-studio
|
|
|
|
PRIVATE DL_${graphics_library_U}="$<TARGET_FILE_NAME:OBS::libobs-${graphics_library}>")
|
2022-03-16 23:11:58 +01:00
|
|
|
else()
|
2023-03-26 03:55:25 +02:00
|
|
|
target_compile_definitions(obs-studio PRIVATE DL_${graphics_library_U}="")
|
2022-03-16 23:11:58 +01:00
|
|
|
endif()
|
2023-03-26 03:55:25 +02:00
|
|
|
endforeach()
|
2022-07-31 18:04:55 +02:00
|
|
|
|
2023-03-28 19:50:59 +02:00
|
|
|
# cmake-format: off
|
|
|
|
set_target_properties_obs(obs-studio PROPERTIES FOLDER frontend OUTPUT_NAME "$<IF:$<PLATFORM_ID:Windows>,obs64,obs>")
|
|
|
|
# cmake-format: on
|