UI: Update CMakeLists.txt for main OBS app

master
PatTheMav 2022-03-16 23:11:58 +01:00
parent 1fd7770548
commit 1f0f2be15e
No known key found for this signature in database
GPG Key ID: CEFD5D83C12A66B3
21 changed files with 853 additions and 1020 deletions

View File

@ -1,502 +1,413 @@
if(DISABLE_UI)
message(STATUS "UI disabled")
return()
elseif(ENABLE_UI)
set(FIND_MODE REQUIRED)
else()
set(FIND_MODE QUIET)
endif()
if(BROWSER_AVAILABLE_INTERNAL)
add_definitions(-DBROWSER_AVAILABLE)
endif()
add_subdirectory(obs-frontend-api)
# ----------------------------------------------------------------------------
option(ENABLE_UI "Enable building with UI (requires Qt)" ON)
if(NOT ENABLE_UI)
message(STATUS "OBS: DISABLED OBS UI")
return()
endif()
if(NOT QT_VERSION)
set(QT_VERSION
"5"
CACHE STRING "OBS Qt version [5, 6]" FORCE)
set_property(CACHE QT_VERSION PROPERTY STRINGS 5 6)
endif()
project(obs)
set(DISABLE_UPDATE_MODULE TRUE CACHE BOOL "Disables building the update module")
# Legacy support
if(TARGET obs-browser
AND NOT TARGET OBS::browser-panels
AND BROWSER_PANEL_SUPPORT_ENABLED)
add_library(obs-browser-panels INTERFACE)
add_library(OBS::browser-panels ALIAS obs-browser-panels)
if(NOT DEFINED TWITCH_CLIENTID OR "${TWITCH_CLIENTID}" STREQUAL "" OR
NOT DEFINED TWITCH_HASH OR "${TWITCH_HASH}" STREQUAL "" OR
NOT BROWSER_AVAILABLE_INTERNAL)
set(TWITCH_ENABLED FALSE)
set(TWITCH_CLIENTID "")
set(TWITCH_HASH "0")
target_include_directories(
obs-browser-panels INTERFACE ${CMAKE_SOURCE_DIR}/plugins/obs-browser/panel)
endif()
if(NOT DEFINED TWITCH_CLIENTID
OR "${TWITCH_CLIENTID}" STREQUAL ""
OR NOT DEFINED TWITCH_HASH
OR "${TWITCH_HASH}" STREQUAL ""
OR NOT TARGET OBS::browser-panels)
set(TWITCH_ENABLED OFF)
set(TWITCH_CLIENTID "")
set(TWITCH_HASH "0")
else()
set(TWITCH_ENABLED TRUE)
set(TWITCH_ENABLED ON)
endif()
if(NOT DEFINED RESTREAM_CLIENTID OR "${RESTREAM_CLIENTID}" STREQUAL "" OR
NOT DEFINED RESTREAM_HASH OR "${RESTREAM_HASH}" STREQUAL "" OR
NOT BROWSER_AVAILABLE_INTERNAL)
set(RESTREAM_ENABLED FALSE)
set(RESTREAM_CLIENTID "")
set(RESTREAM_HASH "0")
if(NOT DEFINED RESTREAM_CLIENTID
OR "${RESTREAM_CLIENTID}" STREQUAL ""
OR NOT DEFINED RESTREAM_HASH
OR "${RESTREAM_HASH}" STREQUAL ""
OR NOT TARGET OBS::browser-panels)
set(RESTREAM_ENABLED OFF)
set(RESTREAM_CLIENTID "")
set(RESTREAM_HASH "0")
else()
set(RESTREAM_ENABLED TRUE)
set(RESTREAM_ENABLED ON)
endif()
if(DEFINED ENV{YOUTUBE_CLIENTID} AND NOT DEFINED YOUTUBE_CLIENTID)
set(YOUTUBE_CLIENTID "$ENV{YOUTUBE_CLIENTID}")
endif()
if(DEFINED ENV{YOUTUBE_CLIENTID_HASH} AND NOT DEFINED YOUTUBE_CLIENTID_HASH)
set(YOUTUBE_CLIENTID_HASH "$ENV{YOUTUBE_CLIENTID_HASH}")
endif()
if(DEFINED ENV{YOUTUBE_SECRET} AND NOT DEFINED YOUTUBE_SECRET)
set(YOUTUBE_SECRET "$ENV{YOUTUBE_SECRET}")
endif()
if(DEFINED ENV{YOUTUBE_SECRET_HASH} AND NOT DEFINED YOUTUBE_SECRET_HASH)
set(YOUTUBE_SECRET_HASH "$ENV{YOUTUBE_SECRET_HASH}")
endif()
if(NOT DEFINED YOUTUBE_CLIENTID OR "${YOUTUBE_CLIENTID}" STREQUAL "" OR
NOT DEFINED YOUTUBE_SECRET OR "${YOUTUBE_SECRET}" STREQUAL "" OR
NOT DEFINED YOUTUBE_CLIENTID_HASH OR "${YOUTUBE_CLIENTID_HASH}" STREQUAL "" OR
NOT DEFINED YOUTUBE_SECRET_HASH OR "${YOUTUBE_SECRET_HASH}" STREQUAL "")
set(YOUTUBE_ENABLED FALSE)
if(NOT DEFINED YOUTUBE_CLIENTID
OR "${YOUTUBE_CLIENTID}" STREQUAL ""
OR NOT DEFINED YOUTUBE_SECRET
OR "${YOUTUBE_SECRET}" STREQUAL ""
OR NOT DEFINED YOUTUBE_CLIENTID_HASH
OR "${YOUTUBE_CLIENTID_HASH}" STREQUAL ""
OR NOT DEFINED YOUTUBE_SECRET_HASH
OR "${YOUTUBE_SECRET_HASH}" STREQUAL "")
set(YOUTUBE_ENABLED OFF)
else()
set(YOUTUBE_ENABLED TRUE)
set(YOUTUBE_ENABLED ON)
endif()
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/ui-config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/ui-config.h")
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
set(CMAKE_AUTOMOC TRUE)
find_package(Threads REQUIRED)
find_package(Qt5Network ${FIND_MODE})
find_package(Qt5Widgets ${FIND_MODE})
find_package(Qt5Svg ${FIND_MODE})
if(WIN32 AND (Qt5Widgets_VERSION VERSION_LESS 6.0.0))
find_package(Qt5WinExtras ${FIND_MODE})
endif()
find_package(Qt5Xml ${FIND_MODE})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ui-config.h.in
${CMAKE_CURRENT_BINARY_DIR}/ui-config.h)
find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil avformat)
find_package(CURL REQUIRED)
if(NOT Qt5Widgets_FOUND)
if (ENABLE_UI)
message(FATAL_ERROR "Failed to find Qt5")
else()
message(STATUS "Qt5 not found - UI disabled")
return()
endif()
endif()
add_subdirectory(frontend-plugins)
add_executable(obs)
find_qt(
VERSION ${QT_VERSION}
COMPONENTS Widgets Network Svg Xml
COMPONENTS_WIN WinExtras
COMPONENTS_LINUX Gui)
include_directories(${FFMPEG_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(SYSTEM "obs-frontend-api")
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/deps/libff")
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/deps/json11")
if(BROWSER_AVAILABLE_INTERNAL)
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/plugins/obs-browser/panel")
endif()
target_link_libraries(obs PRIVATE Qt::Widgets Qt::Svg Qt::Xml Qt::Network)
find_package(Libcurl REQUIRED)
include_directories(${LIBCURL_INCLUDE_DIRS})
add_definitions(${LIBCURL_DEFINITIONS})
set_target_properties(
obs
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS "forms;forms/source-toolbar")
if(WIN32)
include_directories(${BLAKE2_INCLUDE_DIR})
target_include_directories(obs PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR})
set(obs_PLATFORM_SOURCES
platform-windows.cpp
win-update/update-window.cpp
win-update/win-update.cpp
win-update/win-update-helpers.cpp
${obs-studio_BINARY_DIR}/obs.rc)
set(obs_PLATFORM_HEADERS
win-update/update-window.hpp
win-update/win-update.hpp
win-update/win-update-helpers.hpp)
set(obs_PLATFORM_LIBRARIES
crypt32
blake2)
target_sources(obs PRIVATE forms/obs.qrc)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
endif()
elseif(APPLE)
set(obs_PLATFORM_SOURCES
platform-osx.mm)
target_sources(
obs
PRIVATE auth-oauth.cpp
auth-oauth.hpp
auth-listener.cpp
auth-listener.hpp
obf.c
obf.h
obs-app.cpp
obs-app.hpp
obs-proxy-style.cpp
obs-proxy-style.hpp
api-interface.cpp
auth-base.cpp
auth-base.hpp
crash-report.cpp
crash-report.hpp
display-helpers.hpp
platform.hpp
qt-display.cpp
qt-display.hpp
qt-wrappers.cpp
qt-wrappers.hpp
ui-validation.cpp
ui-validation.hpp
${CMAKE_SOURCE_DIR}/deps/json11/json11.cpp
${CMAKE_SOURCE_DIR}/deps/json11/json11.hpp
${CMAKE_SOURCE_DIR}/deps/libff/libff/ff-util.c
${CMAKE_SOURCE_DIR}/deps/libff/libff/ff-util.h
${CMAKE_CURRENT_BINARY_DIR}/ui-config.h)
find_package(AppKit REQUIRED)
set(obs_PLATFORM_LIBRARIES ${APPKIT_LIBRARIES})
target_sources(
obs
PRIVATE adv-audio-control.cpp
adv-audio-control.hpp
audio-encoders.cpp
audio-encoders.hpp
balance-slider.hpp
combobox-ignorewheel.cpp
combobox-ignorewheel.hpp
clickable-label.hpp
double-slider.cpp
double-slider.hpp
horizontal-scroll-area.cpp
horizontal-scroll-area.hpp
item-widget-helpers.cpp
item-widget-helpers.hpp
context-bar-controls.cpp
context-bar-controls.hpp
expand-checkbox.hpp
focus-list.cpp
focus-list.hpp
hotkey-edit.cpp
hotkey-edit.hpp
locked-checkbox.cpp
locked-checkbox.hpp
log-viewer.cpp
log-viewer.hpp
media-controls.cpp
media-controls.hpp
media-slider.cpp
media-slider.hpp
menu-button.cpp
menu-button.hpp
mute-checkbox.hpp
properties-view.cpp
properties-view.hpp
properties-view.moc.hpp
record-button.cpp
record-button.hpp
remote-text.cpp
remote-text.hpp
scene-tree.cpp
scene-tree.hpp
screenshot-obj.hpp
slider-absoluteset-style.cpp
slider-absoluteset-style.hpp
slider-ignorewheel.cpp
slider-ignorewheel.hpp
source-label.cpp
source-label.hpp
spinbox-ignorewheel.cpp
spinbox-ignorewheel.hpp
source-tree.cpp
source-tree.hpp
url-push-button.cpp
url-push-button.hpp
undo-stack-obs.cpp
undo-stack-obs.hpp
volume-control.cpp
volume-control.hpp
vertical-scroll-area.cpp
vertical-scroll-area.hpp
visibility-checkbox.cpp
visibility-checkbox.hpp
visibility-item-widget.cpp
visibility-item-widget.hpp)
add_definitions(-fobjc-arc)
target_sources(
obs
PRIVATE window-basic-about.cpp
window-basic-about.hpp
window-basic-auto-config.cpp
window-basic-auto-config.hpp
window-basic-auto-config-test.cpp
window-basic-adv-audio.cpp
window-basic-adv-audio.hpp
window-basic-filters.cpp
window-basic-filters.hpp
window-basic-interaction.cpp
window-basic-interaction.hpp
window-basic-main.cpp
window-basic-main.hpp
window-basic-main-browser.cpp
window-basic-main-dropfiles.cpp
window-basic-main-icons.cpp
window-basic-main-outputs.cpp
window-basic-main-outputs.hpp
window-basic-main-profiles.cpp
window-basic-main-scene-collections.cpp
window-basic-main-screenshot.cpp
window-basic-main-transitions.cpp
window-basic-preview.cpp
window-basic-properties.cpp
window-basic-properties.hpp
window-basic-settings.cpp
window-basic-settings.hpp
window-basic-settings-stream.cpp
window-basic-source-select.cpp
window-basic-source-select.hpp
window-basic-stats.cpp
window-basic-stats.hpp
window-basic-status-bar.cpp
window-basic-status-bar.hpp
window-basic-transform.cpp
window-basic-transform.hpp
window-basic-preview.hpp
window-dock.cpp
window-dock.hpp
window-importer.cpp
window-importer.hpp
window-log-reply.hpp
window-main.hpp
window-missing-files.cpp
window-missing-files.hpp
window-namedialog.cpp
window-namedialog.hpp
window-log-reply.cpp
window-projector.cpp
window-projector.hpp
window-remux.cpp
window-remux.hpp)
option(ENABLE_SPARKLE_UPDATER "Enables updates via the Sparkle framework (don't forget to update the Info.plist for your .app)" OFF)
if(ENABLE_SPARKLE_UPDATER)
find_library(SPARKLE Sparkle)
include_directories(${SPARKLE})
set(obs_PLATFORM_SOURCES
${obs_PLATFORM_SOURCES}
sparkle-updater.mm)
set(obs_PLATFORM_LIBRARIES
${obs_PLATFORM_LIBRARIES}
${SPARKLE})
add_definitions(-DUPDATE_SPARKLE=1)
endif()
target_sources(
obs
PRIVATE importers/importers.cpp importers/importers.hpp importers/classic.cpp
importers/sl.cpp importers/studio.cpp importers/xsplit.cpp)
elseif(UNIX)
find_package(Qt5Gui REQUIRED)
find_package(PythonDeps QUIET)
target_compile_features(obs PRIVATE cxx_std_17)
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
target_include_directories(obs PRIVATE ${CMAKE_SOURCE_DIR}/deps/json11
${CMAKE_SOURCE_DIR}/deps/libff)
set(obs_PLATFORM_SOURCES
platform-x11.cpp)
set(obs_PLATFORM_LIBRARIES
${obs_PLATFORM_LIBRARIES}
Qt5::Gui
Qt5::GuiPrivate)
if("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
list(APPEND obs_PLATFORM_LIBRARIES
procstat)
endif()
endif()
if(BROWSER_AVAILABLE_INTERNAL)
list(APPEND obs_PLATFORM_SOURCES
window-dock-browser.cpp
window-extra-browsers.cpp
)
list(APPEND obs_PLATFORM_HEADERS
window-dock-browser.hpp
window-extra-browsers.hpp
)
if(TWITCH_ENABLED)
list(APPEND obs_PLATFORM_SOURCES
auth-twitch.cpp
)
list(APPEND obs_PLATFORM_HEADERS
auth-twitch.hpp
)
endif()
if(RESTREAM_ENABLED)
list(APPEND obs_PLATFORM_SOURCES
auth-restream.cpp
)
list(APPEND obs_PLATFORM_HEADERS
auth-restream.hpp
)
endif()
endif()
if(YOUTUBE_ENABLED)
list(APPEND obs_PLATFORM_SOURCES
auth-youtube.cpp
youtube-api-wrappers.cpp
)
list(APPEND obs_PLATFORM_HEADERS
auth-youtube.hpp
youtube-api-wrappers.hpp
)
endif()
set(obs_libffutil_SOURCES
../deps/libff/libff/ff-util.c
)
set(obs_libffutil_HEADERS
../deps/libff/libff/ff-util.h
)
if(MSVC)
set_source_files_properties(
../deps/libff/libff/ff-util.c
PROPERTIES COMPILE_FLAGS -Dinline=__inline
)
set(obs_PLATFORM_LIBRARIES
${obs_PLATFORM_LIBRARIES}
w32-pthreads)
endif()
set(obs_SOURCES
${obs_PLATFORM_SOURCES}
${obs_libffutil_SOURCES}
../deps/json11/json11.cpp
obs-app.cpp
window-dock.cpp
api-interface.cpp
window-basic-main.cpp
window-basic-stats.cpp
window-basic-filters.cpp
window-basic-settings.cpp
window-basic-interaction.cpp
window-basic-properties.cpp
window-basic-auto-config.cpp
window-basic-main-outputs.cpp
window-basic-source-select.cpp
window-basic-settings-stream.cpp
window-basic-main-screenshot.cpp
window-basic-auto-config-test.cpp
window-basic-main-scene-collections.cpp
window-basic-main-transitions.cpp
window-basic-main-dropfiles.cpp
window-basic-main-profiles.cpp
window-basic-main-browser.cpp
window-basic-main-icons.cpp
window-basic-status-bar.cpp
window-basic-adv-audio.cpp
window-basic-transform.cpp
window-basic-preview.cpp
window-basic-about.cpp
window-importer.cpp
media-controls.cpp
window-namedialog.cpp
window-log-reply.cpp
window-projector.cpp
window-remux.cpp
window-missing-files.cpp
auth-base.cpp
auth-oauth.cpp
auth-listener.cpp
obf.c
source-tree.cpp
scene-tree.cpp
properties-view.cpp
focus-list.cpp
menu-button.cpp
double-slider.cpp
slider-ignorewheel.cpp
combobox-ignorewheel.cpp
spinbox-ignorewheel.cpp
record-button.cpp
ui-validation.cpp
url-push-button.cpp
volume-control.cpp
adv-audio-control.cpp
item-widget-helpers.cpp
context-bar-controls.cpp
horizontal-scroll-area.cpp
vertical-scroll-area.cpp
visibility-item-widget.cpp
slider-absoluteset-style.cpp
qt-display.cpp
crash-report.cpp
hotkey-edit.cpp
source-label.cpp
remote-text.cpp
audio-encoders.cpp
qt-wrappers.cpp
log-viewer.cpp
obs-proxy-style.cpp
locked-checkbox.cpp
visibility-checkbox.cpp
media-slider.cpp
undo-stack-obs.cpp)
set(obs_HEADERS
${obs_PLATFORM_HEADERS}
${obs_libffutil_HEADERS}
../deps/json11/json11.hpp
obs-app.hpp
platform.hpp
window-dock.hpp
window-main.hpp
window-basic-main.hpp
window-basic-stats.hpp
window-basic-filters.hpp
window-basic-settings.hpp
window-basic-interaction.hpp
window-basic-properties.hpp
window-basic-auto-config.hpp
window-basic-main-outputs.hpp
window-basic-source-select.hpp
window-basic-about.hpp
window-basic-status-bar.hpp
window-basic-adv-audio.hpp
window-basic-transform.hpp
window-basic-preview.hpp
window-importer.hpp
media-controls.hpp
window-namedialog.hpp
window-log-reply.hpp
window-projector.hpp
window-remux.hpp
window-missing-files.hpp
auth-base.hpp
auth-oauth.hpp
auth-listener.hpp
obf.h
source-tree.hpp
scene-tree.hpp
properties-view.hpp
properties-view.moc.hpp
display-helpers.hpp
balance-slider.hpp
double-slider.hpp
slider-ignorewheel.hpp
combobox-ignorewheel.hpp
spinbox-ignorewheel.hpp
focus-list.hpp
menu-button.hpp
mute-checkbox.hpp
record-button.hpp
ui-validation.hpp
screenshot-obj.hpp
url-push-button.hpp
volume-control.hpp
adv-audio-control.hpp
item-widget-helpers.hpp
visibility-checkbox.hpp
context-bar-controls.hpp
locked-checkbox.hpp
horizontal-scroll-area.hpp
expand-checkbox.hpp
vertical-scroll-area.hpp
visibility-item-widget.hpp
slider-absoluteset-style.hpp
qt-display.hpp
crash-report.hpp
hotkey-edit.hpp
source-label.hpp
remote-text.hpp
audio-encoders.hpp
qt-wrappers.hpp
clickable-label.hpp
log-viewer.hpp
obs-proxy-style.hpp
obs-proxy-style.hpp
media-slider.hpp
undo-stack-obs.hpp)
set(obs_importers_HEADERS
importers/importers.hpp)
set(obs_importers_SOURCES
importers/importers.cpp
importers/classic.cpp
importers/sl.cpp
importers/studio.cpp
importers/xsplit.cpp)
source_group("importers\\Source Files" FILES ${obs_importers_SOURCES})
source_group("importers\\Header Files" FILES ${obs_importers_HEADERS})
set(obs_UI
forms/source-toolbar/browser-source-toolbar.ui
forms/source-toolbar/device-select-toolbar.ui
forms/source-toolbar/game-capture-toolbar.ui
forms/source-toolbar/image-source-toolbar.ui
forms/source-toolbar/color-source-toolbar.ui
forms/source-toolbar/text-source-toolbar.ui
forms/source-toolbar/media-controls.ui
forms/AutoConfigStartPage.ui
forms/AutoConfigVideoPage.ui
forms/AutoConfigStreamPage.ui
forms/AutoConfigTestPage.ui
forms/ColorSelect.ui
forms/OBSLogReply.ui
forms/OBSBasic.ui
forms/OBSBasicTransform.ui
forms/OBSBasicFilters.ui
forms/OBSBasicSettings.ui
forms/OBSBasicSourceSelect.ui
forms/OBSBasicInteraction.ui
forms/OBSExtraBrowsers.ui
forms/OBSUpdate.ui
forms/OBSRemux.ui
forms/OBSImporter.ui
forms/OBSMissingFiles.ui
forms/OBSAbout.ui)
set(obs_QRC
forms/obs.qrc)
if(YOUTUBE_ENABLED)
list(APPEND obs_SOURCES
window-youtube-actions.cpp
)
list(APPEND obs_HEADERS
window-youtube-actions.hpp
)
list(APPEND obs_UI
forms/OBSYoutubeActions.ui
)
endif()
qt5_wrap_ui(obs_UI_HEADERS ${obs_UI})
qt5_add_resources(obs_QRC_SOURCES ${obs_QRC})
add_executable(obs WIN32
obs.manifest
${obs_SOURCES}
${obs_HEADERS}
${obs_importers_SOURCES}
${obs_importers_HEADERS}
${obs_UI_HEADERS}
${obs_QRC_SOURCES})
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_output_suffix "64")
else()
set(_output_suffix "32")
endif()
set_target_properties(obs
PROPERTIES
OUTPUT_NAME "obs${_output_suffix}")
if(Qt5Widgets_VERSION VERSION_LESS 6.0.0)
target_link_libraries(obs
Qt5::WinExtras)
endif()
endif()
target_link_libraries(obs
libobs
Threads::Threads
Qt5::Network
Qt5::Widgets
Qt5::Svg
Qt5::Xml
obs-frontend-api
${FFMPEG_LIBRARIES}
${LIBCURL_LIBRARIES}
${obs_PLATFORM_LIBRARIES})
target_link_libraries(
obs PRIVATE CURL::libcurl FFmpeg::avcodec FFmpeg::avutil FFmpeg::avformat
OBS::libobs OBS::frontend-api)
set_target_properties(obs PROPERTIES FOLDER "frontend")
if(TARGET OBS::browser-panels)
get_target_property(_PANEL_INCLUDE_DIRECTORY OBS::browser-panels
INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(obs PRIVATE ${_PANEL_INCLUDE_DIRECTORY})
target_compile_definitions(obs PRIVATE BROWSER_AVAILABLE)
target_sources(
obs PRIVATE window-dock-browser.cpp window-dock-browser.hpp
window-extra-browsers.cpp window-extra-browsers.hpp)
if(TWITCH_ENABLED)
target_sources(obs PRIVATE auth-twitch.cpp auth-twitch.hpp)
endif()
if(RESTREAM_ENABLED)
target_sources(obs PRIVATE auth-restream.cpp auth-restream.hpp)
endif()
endif()
if(YOUTUBE_ENABLED)
target_sources(
obs
PRIVATE auth-youtube.cpp auth-youtube.hpp youtube-api-wrappers.cpp
youtube-api-wrappers.hpp window-youtube-actions.cpp
window-youtube-actions.hpp)
endif()
if(OS_WINDOWS)
set_target_properties(obs PROPERTIES WIN32_EXECUTABLE ON OUTPUT_NAME
"obs${_ARCH_SUFFIX}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/obs.rc.in
${CMAKE_BINARY_DIR}/obs.rc)
target_sources(
obs
PRIVATE obs.manifest
platform-windows.cpp
win-update/update-window.cpp
win-update/update-window.hpp
win-update/win-update.cpp
win-update/win-update.hpp
win-update/win-update-helpers.cpp
win-update/win-update-helpers.hpp
${CMAKE_BINARY_DIR}/obs.rc)
target_link_libraries(obs PRIVATE crypt32 OBS::blake2 Qt::WinExtras)
target_compile_features(obs PRIVATE cxx_std_17)
target_compile_definitions(
obs PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS
_CRT_NONSTDC_NO_WARNINGS)
if(MSVC)
target_link_libraries(obs PRIVATE OBS::w32-pthreads)
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}../deps/libff/libff/ff-util.c
PROPERTIES COMPILE_FLAGS -Dinline=__inline)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
target_link_options(obs PRIVATE /LARGEADDRESSAWARE)
endif()
add_subdirectory(win-update/updater)
elseif(OS_MACOS)
set_target_properties(
obs
PROPERTIES OUTPUT_NAME ${OBS_BUNDLE_NAME}
MACOSX_BUNDLE ON
MACOSX_BUNDLE_INFO_PLIST
${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/Info.plist.in)
if(XCODE)
set_target_properties(
obs
PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER
"${MACOSX_BUNDLE_GUI_IDENTIFIER}"
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon
XCODE_ATTRIBUTE_PRODUCT_NAME "OBS")
set(APP_ICON_TARGET ${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/Assets.xcassets)
target_sources(obs PRIVATE ${APP_ICON_TARGET})
set_source_files_properties(${APP_ICON_TARGET}
PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
else()
set(APP_ICON_TARGET ${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/AppIcon.iconset)
set(APP_ICON_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/AppIcon.icns)
add_custom_command(
OUTPUT ${APP_ICON_OUTPUT} COMMAND iconutil -c icns "${APP_ICON_TARGET}"
-o "${APP_ICON_OUTPUT}")
set(MACOSX_BUNDLE_ICON_FILE AppIcon.icns)
target_sources(obs PRIVATE ${APP_ICON_OUTPUT}
${CMAKE_CURRENT_SOURCE_DIR}/../AUTHORS)
set_source_files_properties(${APP_ICON_OUTPUT}
PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
endif()
find_library(APPKIT Appkit)
mark_as_advanced(APPKIT)
target_link_libraries(obs PRIVATE ${APPKIT})
if(ENABLE_SPARKLE_UPDATER)
find_library(SPARKLE Sparkle)
mark_as_advanced(SPARKLE)
target_sources(obs PRIVATE sparkle-updater.mm)
target_compile_definitions(obs PRIVATE ENABLE_SPARKLE_UPDATER)
target_link_libraries(obs PRIVATE ${SPARKLE})
endif()
target_sources(obs PRIVATE platform-osx.mm)
set_source_files_properties(platform-osx.mm PROPERTIES COMPILE_FLAGS
-fobjc-arc)
elseif(OS_POSIX)
target_sources(obs PRIVATE platform-x11.cpp)
target_link_libraries(obs PRIVATE Qt${QT_VERSION}::GuiPrivate)
if(TARGET obspython)
find_package(Python REQUIRED COMPONENTS Interpreter Development)
target_link_libraries(obs PRIVATE Python::Python)
target_link_options(obs PRIVATE "LINKER:-no-as-needed")
endif()
if(NOT LINUX_PORTABLE)
add_subdirectory(xdg-data)
endif()
if(OS_FREEBSD)
target_link_libraries(obs PRIVATE procstat)
endif()
endif()
define_graphic_modules(obs)
install_obs_core(obs)
install_obs_data(obs data obs-studio)
install_obs_data_file(obs ../AUTHORS obs-studio/authors)
if (UNIX AND UNIX_STRUCTURE AND NOT APPLE)
add_subdirectory(xdg-data)
endif()
if (UNIX AND NOT APPLE)
# python symbols must be in the global symbol table
# so we link the main executable to python if we expect
# obs-scripting python support to be enabled.
# see: https://github.com/obsproject/obs-studio/issues/2222 and https://bugs.python.org/issue36721
if(NOT DISABLE_PYTHON AND PYTHONLIBS_FOUND)
target_link_libraries(obs ${PYTHON_LIBRARIES})
set_target_properties(obs PROPERTIES LINK_FLAGS "-Wl,--no-as-needed")
# Use this after cmake 3.13 aka we drop ubuntu 18.04.
# target_link_options(obs PRIVATE "LINKER:-no-as-needed")
endif()
endif()
add_subdirectory(frontend-plugins)
if(WIN32)
add_subdirectory(win-update/updater)
endif()
setup_obs_app(obs)
setup_target_resources(obs obs-studio)
add_target_resource(obs ${CMAKE_CURRENT_SOURCE_DIR}/../AUTHORS
obs-studio/authors)

View File

@ -1,161 +1,85 @@
project(aja-output-ui)
if(DISABLE_AJA)
message(STATUS "aja-output-ui plugin disabled")
return()
if(NOT ENABLE_AJA)
return()
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
find_package(LibAJANTV2)
if (NOT LIBAJANTV2_FOUND)
message(STATUS "aja-output-ui plugin disabled (deps not found)")
return()
else()
message("aja-output-ui includes: ${LIBAJANTV2_INCLUDE_DIRS}")
message("aja-output-ui libs: ${LIBAJANTV2_LIBRARIES}")
endif()
find_package(LibAJANTV2 REQUIRED)
add_library(aja-output-ui MODULE)
add_library(OBS::aja-output-ui ALIAS aja-output-ui)
find_qt(VERSION ${QT_VERSION} COMPONENTS Widgets)
set_target_properties(
aja-output-ui
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS "forms")
target_sources(
aja-output-ui
PRIVATE AJAOutputUI.h
AJAOutputUI.cpp
aja-ui-main.cpp
aja-ui-main.h
${CMAKE_SOURCE_DIR}/plugins/aja/aja-card-manager.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-card-manager.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-common.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-common.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-enums.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-presets.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-presets.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-props.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-props.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-routing.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-routing.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-ui-props.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-vpid-data.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-vpid-data.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-widget-io.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-widget-io.hpp
${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/double-slider.cpp
${CMAKE_SOURCE_DIR}/UI/double-slider.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.cpp
${CMAKE_SOURCE_DIR}/UI/properties-view.moc.hpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.cpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.hpp
${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp)
target_link_libraries(aja-output-ui PRIVATE OBS::libobs OBS::frontend-api
Qt::Widgets AJA::LibAJANTV2)
if(OS_MACOS)
find_library(IOKIT_FRAMEWORK Iokit)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(APPKIT_FRAMEWORK AppKit)
target_link_libraries(aja-output-ui PRIVATE ${IOKIT} ${COREFOUNDATION}
${APPKIT})
elseif(OS_WINDOWS)
set(MODULE_DESCRIPTION "OBS AJA Output UI")
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
aja-output-ui.rc)
target_sources(aja-output-ui PRIVATE aja-output-ui.rc)
target_link_libraries(aja-output-ui PRIVATE ws2_32.lib setupapi.lib Winmm.lib
netapi32.lib Shlwapi.lib)
else()
message(STATUS "aja-output-ui disabled (32-bit not supported)")
return()
find_package(X11 REQUIRED)
target_link_libraries(aja-output-ui PRIVATE X11::X11
Qt${QT_VERSION}::GuiPrivate)
endif()
if(APPLE)
find_library(COCOA Cocoa)
include_directories(${COCOA})
endif()
set_target_properties(aja-output-ui PROPERTIES FOLDER "frontend" PREFIX "")
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
link_libraries(${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})
find_package(Qt5X11Extras REQUIRED)
endif()
set(aja-output-ui_HEADERS
${aja-output-ui_HEADERS}
../../qt-wrappers.hpp
../../properties-view.hpp
../../properties-view.moc.hpp
../../vertical-scroll-area.hpp
../../double-slider.hpp
../../slider-ignorewheel.hpp
../../combobox-ignorewheel.hpp
../../spinbox-ignorewheel.hpp
AJAOutputUI.h
aja-ui-main.h
../../../plugins/aja/aja-card-manager.hpp
../../../plugins/aja/aja-common.hpp
../../../plugins/aja/aja-enums.hpp
../../../plugins/aja/aja-presets.hpp
../../../plugins/aja/aja-props.hpp
../../../plugins/aja/aja-routing.hpp
../../../plugins/aja/aja-ui-props.hpp
../../../plugins/aja/aja-vpid-data.hpp
../../../plugins/aja/aja-widget-io.hpp
)
set(aja-output-ui_SOURCES
${aja-output-ui_SOURCES}
../../qt-wrappers.cpp
../../properties-view.cpp
../../vertical-scroll-area.cpp
../../double-slider.cpp
../../slider-ignorewheel.cpp
../../combobox-ignorewheel.cpp
../../spinbox-ignorewheel.cpp
AJAOutputUI.cpp
aja-ui-main.cpp
../../../plugins/aja/aja-card-manager.cpp
../../../plugins/aja/aja-common.cpp
../../../plugins/aja/aja-presets.cpp
../../../plugins/aja/aja-props.cpp
../../../plugins/aja/aja-routing.cpp
../../../plugins/aja/aja-vpid-data.cpp
../../../plugins/aja/aja-widget-io.cpp
)
set(aja-output-ui_UI
${aja-output-ui_UI}
forms/output.ui)
if(WIN32)
set(MODULE_DESCRIPTION "OBS AJA Output UI")
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in aja-output-ui.rc)
list(APPEND aja-output-ui_SOURCES
aja-output-ui.rc)
endif()
if(APPLE)
set(aja-output-ui_PLATFORM_LIBS
${COCOA})
endif()
qt5_wrap_ui(aja-output-ui_UI_HEADERS
${aja-output-ui_UI})
add_library(aja-output-ui MODULE
${aja-output-ui_HEADERS}
${aja-output-ui_SOURCES}
${aja-output-ui_UI_HEADERS})
set(aja_LIBRARIES
$<IF:$<CONFIG:Debug>,${LIBAJANTV2_DEBUG_LIBRARIES},${LIBAJANTV2_LIBRARIES}>
libobs)
# macOS
if(APPLE)
set(aja_COMPILE_DEFS
AJAMac
AJA_MAC)
find_library(IOKIT_FRAMEWORK Iokit)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(APPKIT_FRAMEWORK AppKit)
list(APPEND aja_LIBRARIES
${IOKIT_FRAMEWORK}
${COREFOUNDATION_LIBRARY}
${APPKIT_FRAMEWORK})
# Windows
elseif(WIN32)
set(aja_COMPILE_DEFS
AJA_WINDOWS
_WINDOWS
WIN32
MSWindows)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
list(APPEND aja_COMPILE_DEFS
_DEBUG)
else()
list(APPEND aja_COMPILE_DEFS
NDEBUG)
endif()
list(APPEND aja_LIBRARIES
ws2_32.lib
setupapi.lib
Winmm.lib
netapi32.lib
Shlwapi.lib)
# Linux
elseif(UNIX AND NOT APPLE)
set(aja_COMPILE_DEFS
AJA_LINUX
AJALinux)
endif()
target_include_directories(aja-output-ui PUBLIC
${LIBAJANTV2_INCLUDE_DIRS})
target_compile_definitions(aja-output-ui PUBLIC ${aja_COMPILE_DEFS})
target_link_libraries(aja-output-ui
${frontend-tools_PLATFORM_LIBS}
${aja_LIBRARIES}
obs-frontend-api
Qt5::Widgets
libobs)
set_target_properties(aja-output-ui PROPERTIES FOLDER "frontend")
install_obs_plugin_with_data(aja-output-ui data)
setup_plugin_target(aja-output-ui)

View File

@ -1,51 +1,48 @@
project(decklink-captions)
if(APPLE)
find_library(COCOA Cocoa)
include_directories(${COCOA})
if(NOT ENABLE_DECKLINK)
return()
endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
link_libraries(${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})
add_library(decklink-captions MODULE)
add_library(OBS::decklink-captions ALIAS decklink-captions)
find_qt(VERSION ${QT_VERSION} COMPONENTS Widgets)
target_link_libraries(decklink-captions PRIVATE Qt::Widgets)
set_target_properties(
decklink-captions
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS "forms")
target_compile_features(decklink-captions PRIVATE cxx_std_17)
target_sources(decklink-captions PRIVATE decklink-captions.cpp
decklink-captions.h)
target_link_libraries(decklink-captions PRIVATE OBS::frontend-api OBS::libobs)
if(OS_MACOS)
find_library(COCOA Cocoa)
mark_as_advanced(COCOA)
target_link_libraries(decklink-captions PRIVATE ${COCOA})
elseif(OS_POSIX)
find_package(X11 REQUIRED)
mark_as_advanced(X11)
target_link_libraries(decklink-captions PRIVATE X11::X11)
elseif(OS_WINDOWS)
set(MODULE_DESCRIPTION "OBS DeckLink Captions module")
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
decklink-captions.rc)
target_sources(decklink-captions PRIVATE decklink-captions.rc)
endif()
set(decklink-captions_HEADERS
decklink-captions.h
)
set(decklink-captions_SOURCES
decklink-captions.cpp
)
set(decklink-captions_UI
forms/captions.ui
)
set_target_properties(decklink-captions PROPERTIES FOLDER "plugins/decklink"
PREFIX "")
if(WIN32)
set(MODULE_DESCRIPTION "OBS DeckLink Captions module")
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in decklink-captions.rc)
list(APPEND decklink-captions_SOURCES
decklink-captions.rc)
endif()
if(APPLE)
set(decklink-captions_PLATFORM_LIBS
${COCOA})
endif()
qt5_wrap_ui(decklink-captions_UI_HEADERS
${decklink-captions_UI})
add_library(decklink-captions MODULE
${decklink-captions_HEADERS}
${decklink-captions_SOURCES}
${decklink-captions_UI_HEADERS}
)
target_link_libraries(decklink-captions
${frontend-tools_PLATFORM_LIBS}
obs-frontend-api
Qt5::Widgets
libobs)
set_target_properties(decklink-captions PROPERTIES FOLDER "plugins/decklink")
install_obs_plugin_with_data(decklink-captions data)
setup_plugin_target(decklink-captions)

View File

@ -1,72 +1,104 @@
project(decklink-output-ui)
if(APPLE)
find_library(COCOA Cocoa)
include_directories(${COCOA})
if(NOT ENABLE_DECKLINK)
return()
endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
link_libraries(${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})
if(NOT COMMAND find_qt)
macro(find_qt)
set(oneValueArgs VERSION)
set(multiValueArgs COMPONENTS COMPONENTS_WIN COMPONENTS_MAC
COMPONENTS_LINUX)
cmake_parse_arguments(FIND_QT "" "${oneValueArgs}" "${multiValueArgs}"
${ARGN})
if(OS_WINDOWS)
find_package(
Qt${FIND_QT_VERSION}
COMPONENTS ${FIND_QT_COMPONENTS} ${FIND_QT_COMPONENTS_WIN}
REQUIRED)
elseif(OS_MACOS)
find_package(
Qt${FIND_QT_VERSION}
COMPONENTS ${FIND_QT_COMPONENTS} ${FIND_QT_COMPONENTS_MAC}
REQUIRED)
else()
find_package(
Qt${FIND_QT_VERSION}
COMPONENTS ${FIND_QT_COMPONENTS} ${FIND_QT_COMPONENTS_LINUX}
REQUIRED)
endif()
foreach(_COMPONENT IN LISTS ${FIND_QT_COMPONENTS})
if(NOT TARGET Qt::${_COMPONENT} AND TARGET
Qt${FIND_QT_VERSION}::${_COMPONENT})
add_library(Qt::${_COMPONENT} ALIAS Qt${FIND_QT_VERSION}::${_COMPONENT})
endif()
endforeach()
endmacro()
endif()
set(decklink-ouput-ui_HEADERS
${decklink-ouput-ui_HEADERS}
../../qt-wrappers.hpp
../../properties-view.hpp
../../properties-view.moc.hpp
../../vertical-scroll-area.hpp
../../double-slider.hpp
../../slider-ignorewheel.hpp
../../combobox-ignorewheel.hpp
../../spinbox-ignorewheel.hpp
./DecklinkOutputUI.h
decklink-ui-main.h
)
set(decklink-ouput-ui_SOURCES
${decklink-ouput-ui_SOURCES}
../../qt-wrappers.cpp
../../properties-view.cpp
../../vertical-scroll-area.cpp
../../double-slider.cpp
../../slider-ignorewheel.cpp
../../combobox-ignorewheel.cpp
../../spinbox-ignorewheel.cpp
./DecklinkOutputUI.cpp
decklink-ui-main.cpp
)
set(decklink-ouput-ui_UI
${decklink-ouput-ui_UI}
forms/output.ui
)
add_library(decklink-output-ui MODULE)
add_library(OBS::decklink-output-ui ALIAS decklink-output-ui)
if(WIN32)
set(MODULE_DESCRIPTION "OBS DeckLink Output UI")
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in decklink-ouput-ui.rc)
list(APPEND decklink-ouput-ui_SOURCES
decklink-ouput-ui.rc)
find_qt(
VERSION ${QT_VERSION}
COMPONENTS Widgets
COMPONENTS_LINUX Gui)
set_target_properties(
decklink-output-ui
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS "forms")
target_sources(
decklink-output-ui
PRIVATE DecklinkOutputUI.cpp
DecklinkOutputUI.h
decklink-ui-main.cpp
decklink-ui-main.h
${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/double-slider.cpp
${CMAKE_SOURCE_DIR}/UI/double-slider.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.cpp
${CMAKE_SOURCE_DIR}/UI/properties-view.moc.hpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.hpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.cpp
${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp)
target_link_libraries(decklink-output-ui PRIVATE OBS::libobs OBS::frontend-api
Qt::Widgets)
target_compile_features(decklink-output-ui PRIVATE cxx_std_17)
set_target_properties(decklink-output-ui PROPERTIES FOLDER "frontend" PREFIX "")
if(OS_WINDOWS)
set(MODULE_DESCRIPTION "OBS Decklink Output UI")
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
decklink-output-ui.rc)
target_sources(decklink-output-ui PRIVATE decklink-output-ui.rc)
elseif(OS_MACOS)
find_library(COCOA Cocoa)
mark_as_advanced(COCOA)
target_link_libraries(decklink-output-ui PRIVATE ${COCOA})
elseif(OS_POSIX)
find_package(X11 REQUIRED)
target_link_libraries(decklink-output-ui PRIVATE X11::X11
Qt${QT_VERSION}::GuiPrivate)
endif()
if(APPLE)
set(decklink-ouput-ui_PLATFORM_LIBS
${COCOA})
endif()
qt5_wrap_ui(decklink-ouput-ui_UI_HEADERS
${decklink-ouput-ui_UI})
add_library(decklink-ouput-ui MODULE
${decklink-ouput-ui_HEADERS}
${decklink-ouput-ui_SOURCES}
${decklink-ouput-ui_UI_HEADERS}
)
target_link_libraries(decklink-ouput-ui
${frontend-tools_PLATFORM_LIBS}
obs-frontend-api
Qt5::Widgets
libobs)
set_target_properties(decklink-ouput-ui PROPERTIES FOLDER "frontend")
install_obs_plugin_with_data(decklink-ouput-ui data)
setup_plugin_target(decklink-output-ui)

View File

@ -1,128 +1,106 @@
project(frontend-tools)
if(APPLE)
find_library(COCOA Cocoa)
include_directories(${COCOA})
add_library(frontend-tools MODULE)
add_library(OBS::frontend-tools ALIAS frontend-tools)
find_qt(
VERSION ${QT_VERSION}
COMPONENTS Widgets
COMPONENTS_LINUX Gui)
set_target_properties(
frontend-tools
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS "forms")
target_sources(
frontend-tools
PRIVATE frontend-tools.c
auto-scene-switcher.hpp
auto-scene-switcher.cpp
output-timer.hpp
tool-helpers.hpp
output-timer.cpp
${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/double-slider.cpp
${CMAKE_SOURCE_DIR}/UI/double-slider.hpp
${CMAKE_SOURCE_DIR}/UI/horizontal-scroll-area.cpp
${CMAKE_SOURCE_DIR}/UI/horizontal-scroll-area.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.cpp
${CMAKE_SOURCE_DIR}/UI/properties-view.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.moc.hpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.cpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.hpp
${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp)
target_compile_features(frontend-tools PRIVATE cxx_std_17)
target_link_libraries(frontend-tools PRIVATE OBS::frontend-api OBS::libobs
Qt::Widgets)
if(OS_POSIX AND NOT OS_MACOS)
target_link_libraries(frontend-tools PRIVATE Qt${QT_VERSION}::GuiPrivate)
endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
link_libraries(${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})
if(ENABLE_SCRIPTING AND TARGET OBS::scripting)
target_compile_definitions(frontend-tools PRIVATE ENABLE_SCRIPTING)
target_sources(frontend-tools PRIVATE scripts.cpp scripts.hpp)
target_link_libraries(frontend-tools PRIVATE OBS::scripting)
if(TARGET obslua)
target_compile_definitions(frontend-tools PRIVATE LUAJIT_FOUND)
endif()
if(TARGET obspython)
target_compile_definitions(frontend-tools PRIVATE Python_FOUND)
endif()
endif()
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/deps/obs-scripting")
set_target_properties(frontend-tools PROPERTIES FOLDER "frontend" PREFIX "")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/frontend-tools-config.h.in"
"${CMAKE_BINARY_DIR}/config/frontend-tools-config.h")
if(OS_WINDOWS)
set(MODULE_DESCRIPTION "OBS Frontend Tools")
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
frontend-tools.rc)
set(frontend-tools_HEADERS
${frontend-tools_HEADERS}
"${CMAKE_BINARY_DIR}/config/frontend-tools-config.h"
auto-scene-switcher.hpp
output-timer.hpp
tool-helpers.hpp
../../properties-view.hpp
../../properties-view.moc.hpp
../../horizontal-scroll-area.hpp
../../vertical-scroll-area.hpp
../../double-slider.hpp
../../slider-ignorewheel.hpp
../../combobox-ignorewheel.hpp
../../spinbox-ignorewheel.hpp
../../qt-wrappers.hpp
)
set(frontend-tools_SOURCES
${frontend-tools_SOURCES}
auto-scene-switcher.cpp
frontend-tools.c
output-timer.cpp
../../properties-view.cpp
../../horizontal-scroll-area.cpp
../../vertical-scroll-area.cpp
../../double-slider.cpp
../../slider-ignorewheel.cpp
../../combobox-ignorewheel.cpp
../../spinbox-ignorewheel.cpp
../../qt-wrappers.cpp
)
set(frontend-tools_UI
${frontend-tools_UI}
forms/auto-scene-switcher.ui
forms/output-timer.ui
)
target_sources(
frontend-tools
PRIVATE auto-scene-switcher-win.cpp
frontend-tools.rc
captions.cpp
captions.hpp
captions-handler.cpp
captions-handler.hpp
captions-mssapi.cpp
captions-mssapi.hpp
captions-mssapi-stream.cpp
captions-mssapi-stream.hpp)
if(SCRIPTING_ENABLED)
set(frontend-tools_HEADERS
${frontend-tools_HEADERS}
scripts.hpp
)
set(frontend-tools_SOURCES
${frontend-tools_SOURCES}
scripts.cpp
)
set(frontend-tools_UI
${frontend-tools_UI}
forms/scripts.ui
)
set(EXTRA_LIBS
${EXTRA_LIBS}
obs-scripting
)
elseif(OS_MACOS)
find_library(COCOA Cocoa)
mark_as_advanced(COCOA)
target_link_libraries(frontend-tools PRIVATE ${COCOA})
target_sources(frontend-tools PRIVATE auto-scene-switcher-osx.mm)
set_source_files_properties(auto-scene-switcher-osx.mm
PROPERTIES COMPILE_FLAGS -fobjc-arc)
elseif(OS_POSIX)
find_package(X11 REQUIRED)
target_link_libraries(frontend-tools PRIVATE X11::X11)
target_sources(frontend-tools PRIVATE auto-scene-switcher-nix.cpp)
endif()
if(WIN32)
set(MODULE_DESCRIPTION "OBS Frontend Tools")
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in frontend-tools.rc)
set(frontend-tools_PLATFORM_SOURCES
auto-scene-switcher-win.cpp
frontend-tools.rc)
set(frontend-tools_PLATFORM_SOURCES
${frontend-tools_PLATFORM_SOURCES}
captions.cpp
captions-handler.cpp
captions-mssapi.cpp
captions-mssapi-stream.cpp)
set(frontend-tools_PLATFORM_HEADERS
captions.hpp
captions-handler.hpp
captions-mssapi.hpp
captions-mssapi-stream.hpp)
set(frontend-tools_PLATFORM_UI
forms/captions.ui)
elseif(APPLE)
set(frontend-tools_PLATFORM_SOURCES
auto-scene-switcher-osx.mm)
set_source_files_properties(auto-scene-switcher-osx.mm
PROPERTIES COMPILE_FLAGS "-fobjc-arc")
set(frontend-tools_PLATFORM_LIBS
${COCOA})
else()
set(frontend-tools_PLATFORM_SOURCES
auto-scene-switcher-nix.cpp)
endif()
qt5_wrap_ui(frontend-tools_UI_HEADERS
${frontend-tools_UI}
${frontend-tools_PLATFORM_UI})
add_library(frontend-tools MODULE
${frontend-tools_HEADERS}
${frontend-tools_SOURCES}
${frontend-tools_UI_HEADERS}
${frontend-tools_PLATFORM_SOURCES}
${frontend-tools_PLATFORM_HEADERS}
)
target_link_libraries(frontend-tools
${frontend-tools_PLATFORM_LIBS}
${EXTRA_LIBS}
obs-frontend-api
Qt5::Widgets
libobs)
set_target_properties(frontend-tools PROPERTIES FOLDER "frontend")
install_obs_plugin_with_data(frontend-tools data)
setup_plugin_target(frontend-tools)

View File

@ -16,6 +16,6 @@
#define OFF 0
#endif
#define ENABLE_SCRIPTING @SCRIPTING_ENABLED@
#define COMPILE_LUA @COMPILE_LUA@
#define COMPILE_PYTHON @COMPILE_PYTHON@
#cmakedefine ENABLE_SCRIPTING
#cmakedefine LUAJIT_FOUND
#cmakedefine Python_FOUND

View File

@ -1,5 +1,4 @@
#include <obs-module.h>
#include "frontend-tools-config.h"
OBS_DECLARE_MODULE()
OBS_MODULE_USE_DEFAULT_LOCALE("frontend-tools", "en-US")
@ -15,7 +14,7 @@ void FreeCaptions();
void InitOutputTimer();
void FreeOutputTimer();
#if ENABLE_SCRIPTING
#if defined(ENABLE_SCRIPTING)
void InitScripts();
void FreeScripts();
#endif
@ -27,7 +26,7 @@ bool obs_module_load(void)
#endif
InitSceneSwitcher();
InitOutputTimer();
#if ENABLE_SCRIPTING
#if defined(ENABLE_SCRIPTING)
InitScripts();
#endif
return true;
@ -40,7 +39,7 @@ void obs_module_unload(void)
#endif
FreeSceneSwitcher();
FreeOutputTimer();
#if ENABLE_SCRIPTING
#if defined(ENABLE_SCRIPTING)
FreeScripts();
#endif
}

View File

@ -1,6 +1,5 @@
#include "obs-module.h"
#include "scripts.hpp"
#include "frontend-tools-config.h"
#include "../../properties-view.hpp"
#include "../../qt-wrappers.hpp"
@ -33,7 +32,7 @@
#include "ui_scripts.h"
#if COMPILE_PYTHON && (defined(_WIN32) || defined(__APPLE__))
#if defined(Python_FOUND) && (defined(_WIN32) || defined(__APPLE__))
#define PYTHON_UI 1
#else
#define PYTHON_UI 0

View File

@ -2064,6 +2064,12 @@ static int run_program(fstream &logFile, int argc, char *argv[])
#if __APPLE__
InstallNSApplicationSubclass();
if (!isInBundle()) {
blog(LOG_ERROR,
"OBS cannot be run as a standalone binary on macOS. Run the Application bundle instead.");
return ret;
}
#endif
#if !defined(_WIN32) && !defined(__APPLE__) && defined(USE_XDG) && \
@ -2339,13 +2345,13 @@ static void load_debug_privilege(void)
#define CONFIG_PATH BASE_PATH "/config"
#ifndef OBS_UNIX_STRUCTURE
#define OBS_UNIX_STRUCTURE 0
#ifndef LINUX_PORTABLE
#define LINUX_PORTABLE 0
#endif
int GetConfigPath(char *path, size_t size, const char *name)
{
if (!OBS_UNIX_STRUCTURE && portable_mode) {
if (LINUX_PORTABLE && portable_mode) {
if (name && *name) {
return snprintf(path, size, CONFIG_PATH "/%s", name);
} else {
@ -2358,7 +2364,7 @@ int GetConfigPath(char *path, size_t size, const char *name)
char *GetConfigPathPtr(const char *name)
{
if (!OBS_UNIX_STRUCTURE && portable_mode) {
if (LINUX_PORTABLE && portable_mode) {
char path[512];
if (snprintf(path, sizeof(path), CONFIG_PATH "/%s", name) > 0) {
@ -2870,7 +2876,7 @@ int main(int argc, char *argv[])
}
}
#if !OBS_UNIX_STRUCTURE
#if defined(LINUX_PORTABLE)
if (!portable_mode) {
portable_mode =
os_file_exists(BASE_PATH "/portable_mode") ||

View File

@ -1,41 +1,40 @@
if(POLICY CMP0090)
cmake_policy(SET CMP0090 NEW)
endif()
project(obs-frontend-api)
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
add_library(obs-frontend-api SHARED)
add_library(OBS::frontend-api ALIAS obs-frontend-api)
add_definitions(-DLIBOBS_EXPORTS)
target_sources(obs-frontend-api PRIVATE obs-frontend-api.h obs-frontend-api.cpp
obs-frontend-internal.hpp)
set(obs-frontend-api_SOURCES
obs-frontend-api.cpp)
target_link_libraries(obs-frontend-api PRIVATE OBS::libobs)
if(WIN32)
set(MODULE_DESCRIPTION "OBS Frontend API")
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in ./obs-frontend-api.rc)
list(APPEND obs-frontend-api_SOURCES
obs-frontend-api.rc)
target_compile_features(obs-frontend-api PUBLIC cxx_auto_type cxx_std_17
c_std_11)
target_include_directories(
obs-frontend-api PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${OBS_INCLUDE_DESTINATION}>)
set_target_properties(
obs-frontend-api
PROPERTIES FOLDER "frontend"
VERSION "${OBS_VERSION_MAJOR}"
SOVERSION "0"
PUBLIC_HEADER obs-frontend-api.h)
if(OS_WINDOWS)
set(MODULE_DESCRIPTION "OBS Frontend API")
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
obs-frontend-api.rc)
target_sources(obs-frontend-api PRIVATE obs-frontend-api.rc)
elseif(OS_MACOS)
set_target_properties(obs-frontend-api PROPERTIES SOVERSION "1")
endif()
set(obs-frontend-api_PUBLIC_HEADERS
obs-frontend-api.h)
set(obs-frontend-api_HEADERS
obs-frontend-internal.hpp
${obs-frontend-api_PUBLIC_HEADERS})
add_library(obs-frontend-api SHARED
${obs-frontend-api_SOURCES}
${obs-frontend-api_HEADERS})
target_link_libraries(obs-frontend-api
libobs)
set_target_properties(obs-frontend-api PROPERTIES FOLDER "frontend")
if(UNIX AND NOT APPLE)
set_target_properties(obs-frontend-api
PROPERTIES
OUTPUT_NAME obs-frontend-api
VERSION 0.0
SOVERSION 0
)
endif()
install_obs_core(obs-frontend-api)
install_obs_headers(${obs-frontend-api_PUBLIC_HEADERS})
setup_binary_target(obs-frontend-api)
export_target(obs-frontend-api)

View File

@ -0,0 +1,4 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
check_required_components("@PROJECT_NAME@")

View File

@ -1,4 +1,4 @@
IDI_ICON1 ICON DISCARDABLE "../cmake/winrc/obs-studio.ico"
IDI_ICON1 ICON DISCARDABLE "../cmake/bundle/windows/obs-studio.ico"
1 VERSIONINFO
FILEVERSION ${UI_VERSION_MAJOR},${UI_VERSION_MINOR},${UI_VERSION_PATCH},0

View File

@ -37,55 +37,21 @@ bool isInBundle()
bool GetDataFilePath(const char *data, string &output)
{
if (isInBundle()) {
NSRunningApplication *app =
[NSRunningApplication currentApplication];
NSURL *bundleURL = [app bundleURL];
NSString *path = [NSString
stringWithFormat:@"Contents/Resources/data/obs-studio/%@",
[NSString stringWithUTF8String:data]];
NSURL *dataURL = [bundleURL URLByAppendingPathComponent:path];
output = [[dataURL path] UTF8String];
} else {
stringstream str;
str << OBS_DATA_PATH "/obs-studio/" << data;
output = str.str();
}
NSRunningApplication *app = [NSRunningApplication currentApplication];
NSURL *bundleURL = [app bundleURL];
NSString *path = [NSString
stringWithFormat:@"Contents/Resources/%@",
[NSString stringWithUTF8String:data]];
NSURL *dataURL = [bundleURL URLByAppendingPathComponent:path];
output = [[dataURL path] UTF8String];
return !access(output.c_str(), R_OK);
}
#pragma deprecated(InitApplicationBundle)
bool InitApplicationBundle()
{
#ifdef OBS_OSX_BUNDLE
static bool initialized = false;
if (initialized)
return true;
try {
NSBundle *bundle = [NSBundle mainBundle];
if (!bundle)
throw "Could not find main bundle";
NSString *exe_path = [bundle executablePath];
if (!exe_path)
throw "Could not find executable path";
NSString *path = [exe_path stringByDeletingLastPathComponent];
if (chdir([path fileSystemRepresentation]))
throw "Could not change working directory to "
"bundle path";
} catch (const char *error) {
blog(LOG_ERROR, "InitBundle: %s", error);
return false;
}
return initialized = true;
#else
return true;
#endif
}
void CheckIfAlreadyRunning(bool &already_running)

View File

@ -28,7 +28,7 @@ class QWidget;
bool GetDataFilePath(const char *data, std::string &path);
/* Updates the working directory for OSX application bundles */
bool InitApplicationBundle();
bool OBS_DEPRECATED InitApplicationBundle();
std::string GetDefaultVideoSavePath();
@ -77,6 +77,7 @@ bool IsRunningOnWine();
#ifdef __APPLE__
void EnableOSXVSync(bool enable);
void EnableOSXDockIcon(bool enable);
bool isInBundle();
void InstallNSApplicationSubclass();
void disableColorSpaceConversion(QWidget *window);
bool ProcessIsRosettaTranslated();

View File

@ -16,6 +16,8 @@
#define OFF 0
#endif
#cmakedefine USE_XDG
#define TWITCH_ENABLED @TWITCH_ENABLED@
#define TWITCH_CLIENTID "@TWITCH_CLIENTID@"
#define TWITCH_HASH 0x@TWITCH_HASH@

View File

@ -1,52 +1,46 @@
if(DISABLE_UPDATE_MODULE)
return()
project(updater)
option(ENABLE_UPDATER "Build with Windows updater" ON)
if(NOT ENABLE_UPDATER)
message(STATUS "OBS: DISABLED Windows updater")
return()
endif()
if(NOT DEFINED STATIC_ZLIB_PATH OR "${STATIC_ZLIB_PATH}" STREQUAL "")
message(STATUS "STATIC_ZLIB_PATH not set, windows updater disabled")
return()
message(STATUS "STATIC_ZLIB_PATH not set, windows updater disabled")
return()
endif()
project(updater)
add_executable(updater WIN32)
include_directories(${LIBLZMA_INCLUDE_DIRS})
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/deps/json11")
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
include_directories(${BLAKE2_INCLUDE_DIR})
target_sources(
updater
PRIVATE updater.cpp
updater.hpp
patch.cpp
http.cpp
hash.cpp
resource.h
updater.rc
init-hook-files.c
updater.manifest
${CMAKE_SOURCE_DIR}/UI/win-update/win-update-helpers.cpp
${CMAKE_SOURCE_DIR}/UI/win-update/win-update-helpers.hpp
${CMAKE_SOURCE_DIR}/deps/json11/json11.hpp
${CMAKE_SOURCE_DIR}/deps/json11/json11.cpp)
set(updater_HEADERS
${CMAKE_SOURCE_DIR}/deps/json11/json11.hpp
../win-update-helpers.hpp
resource.h
updater.hpp
)
set(updater_SOURCES
${CMAKE_SOURCE_DIR}/deps/json11/json11.cpp
../win-update-helpers.cpp
init-hook-files.c
updater.cpp
patch.cpp
http.cpp
hash.cpp
updater.rc
updater.manifest
)
target_include_directories(
updater PRIVATE ${CMAKE_SOURCE_DIR}/libobs ${CMAKE_SOURCE_DIR}/UI/win-update
${CMAKE_SOURCE_DIR}/deps/json11)
target_compile_definitions(updater PRIVATE NOMINMAX "PSAPI_VERSION=2")
add_definitions(-DNOMINMAX -DUNICODE -D_UNICODE -DPSAPI_VERSION=2)
if(MSVC)
add_compile_options($<IF:$<CONFIG:Debug>,/MTd,/MT>)
target_compile_options(updater PRIVATE $<IF:$<CONFIG:DEBUG>,/MTd,/MT>)
endif()
add_executable(updater WIN32
${updater_HEADERS}
${updater_SOURCES}
)
target_link_libraries(updater
${STATIC_ZLIB_PATH}
lzma
blake2
comctl32
shell32
winhttp
)
target_link_libraries(updater PRIVATE OBS::blake2 OBS::lzma ${STATIC_ZLIB_PATH}
comctl32 shell32 winhttp)
set_target_properties(updater PROPERTIES FOLDER "frontend")

View File

@ -127,7 +127,7 @@ END
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "../../../cmake/winrc/obs-studio.ico"
IDI_ICON1 ICON "../../../cmake/bundle/windows/obs-studio.ico"
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////

View File

@ -131,7 +131,11 @@ void OBSAbout::ShowAuthors()
QString error = "Error! File could not be read.\n\n \
Go to: https://github.com/obsproject/obs-studio/blob/master/AUTHORS";
#ifdef __APPLE__
if (!GetDataFilePath("AUTHORS", path)) {
#else
if (!GetDataFilePath("authors/AUTHORS", path)) {
#endif
ui->textBrowser->setPlainText(error);
return;
}

View File

@ -170,21 +170,35 @@ static void AddExtraModulePaths()
string path = base_module_dir;
#if defined(__APPLE__)
obs_add_module_path((path + "/bin").c_str(), (path + "/data").c_str());
/* System Library Search Path */
obs_add_module_path((path + ".plugin/Contents/MacOS").c_str(),
(path + ".plugin/Contents/Resources").c_str());
BPtr<char> config_bin =
os_get_config_path_ptr("obs-studio/plugins/%module%/bin");
BPtr<char> config_data =
os_get_config_path_ptr("obs-studio/plugins/%module%/data");
/* User Application Support Search Path */
BPtr<char> config_bin = os_get_config_path_ptr(
"obs-studio/plugins/%module%.plugin/Contents/MacOS");
BPtr<char> config_data = os_get_config_path_ptr(
"obs-studio/plugins/%module%.plugin/Contents/Resources");
obs_add_module_path(config_bin, config_data);
#elif ARCH_BITS == 64
/* Legacy System Library Search Path */
obs_add_module_path((path + "/bin").c_str(), (path + "/data").c_str());
/* Legacy User Application Support Search Path */
BPtr<char> config_bin_legacy =
os_get_config_path_ptr("obs-studio/plugins/%module%/bin");
BPtr<char> config_data_legacy =
os_get_config_path_ptr("obs-studio/plugins/%module%/data");
obs_add_module_path(config_bin_legacy, config_data_legacy);
#else
#if ARCH_BITS == 64
obs_add_module_path((path + "/bin/64bit").c_str(),
(path + "/data").c_str());
#else
obs_add_module_path((path + "/bin/32bit").c_str(),
(path + "/data").c_str());
#endif
#endif
}
extern obs_frontend_callbacks *InitializeAPIInterface(OBSBasic *main);
@ -2115,7 +2129,7 @@ void OBSBasic::ReceivedIntroJson(const QString &text)
int minor = 0;
sscanf(version.c_str(), "%d.%d", &major, &minor);
#if OBS_RELEASE_CANDIDATE > 0
#if defined(OBS_RELEASE_CANDIDATE) && OBS_RELEASE_CANDIDATE > 0
if (major == OBS_RELEASE_CANDIDATE_MAJOR &&
minor == OBS_RELEASE_CANDIDATE_MINOR &&
rc == OBS_RELEASE_CANDIDATE) {
@ -2136,7 +2150,7 @@ void OBSBasic::ReceivedIntroJson(const QString &text)
return;
}
#if OBS_RELEASE_CANDIDATE > 0
#if defined(OBS_RELEASE_CANDIDATE) && OBS_RELEASE_CANDIDATE > 0
uint32_t lastVersion = config_get_int(App()->GlobalConfig(), "General",
"LastRCVersion");
#elif OBS_BETA > 0
@ -2149,7 +2163,7 @@ void OBSBasic::ReceivedIntroJson(const QString &text)
int current_version_increment = -1;
#if OBS_RELEASE_CANDIDATE > 0
#if defined(OBS_RELEASE_CANDIDATE) && OBS_RELEASE_CANDIDATE > 0
if (lastVersion < OBS_RELEASE_CANDIDATE_VER) {
#elif OBS_BETA > 0
if (lastVersion < OBS_BETA_VER) {
@ -2642,7 +2656,7 @@ OBSBasic::~OBSBasic()
config_set_int(App()->GlobalConfig(), "General", "LastVersion",
LIBOBS_API_VER);
#if OBS_RELEASE_CANDIDATE > 0
#if defined(OBS_RELEASE_CANDIDATE) && OBS_RELEASE_CANDIDATE > 0
config_set_int(App()->GlobalConfig(), "General", "LastRCVersion",
OBS_RELEASE_CANDIDATE_VER);
#elif OBS_BETA > 0
@ -3626,7 +3640,7 @@ bool OBSBasic::QueryRemoveSource(obs_source_t *source)
#define UPDATE_CHECK_INTERVAL (60 * 60 * 24 * 4) /* 4 days */
#ifdef UPDATE_SPARKLE
#if defined(ENABLE_SPARKLE_UPDATER)
void init_sparkle_updater(bool update_to_undeployed);
void trigger_sparkle_update();
#endif
@ -3639,7 +3653,7 @@ void OBSBasic::TimedCheckForUpdates()
"EnableAutoUpdates"))
return;
#ifdef UPDATE_SPARKLE
#if defined(ENABLE_SPARKLE_UPDATER)
init_sparkle_updater(config_get_bool(App()->GlobalConfig(), "General",
"UpdateToUndeployed"));
#elif _WIN32
@ -3664,7 +3678,7 @@ void OBSBasic::TimedCheckForUpdates()
void OBSBasic::CheckForUpdates(bool manualUpdate)
{
#ifdef UPDATE_SPARKLE
#if defined(ENABLE_SPARKLE_UPDATER)
trigger_sparkle_update();
#elif _WIN32
ui->actionCheckForUpdates->setEnabled(false);

View File

@ -640,7 +640,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
delete ui->browserHWAccel;
delete ui->sourcesGroup;
#endif
#if defined(__APPLE__) || HAVE_PULSEAUDIO
#if defined(__APPLE__) || defined(PULSEAUDIO_FOUND)
delete ui->disableAudioDucking;
#endif
ui->rendererLabel = nullptr;
@ -656,7 +656,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
ui->browserHWAccel = nullptr;
ui->sourcesGroup = nullptr;
#endif
#if defined(__APPLE__) || HAVE_PULSEAUDIO
#if defined(__APPLE__) || defined(PULSEAUDIO_FOUND)
ui->disableAudioDucking = nullptr;
#endif
#endif

View File

@ -1,38 +1,41 @@
if(NOT DEFINED APPDATA_RELEASE_DATE)
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(COMMAND git log --tags -1 --pretty=%cd --date=short
OUTPUT_VARIABLE APPDATA_RELEASE_DATE
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
file(TIMESTAMP "${CMAKE_SOURCE_DIR}/CMakeLists.txt" APPDATA_RELEASE_DATE "%Y-%m-%d")
endif()
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(
COMMAND git log --tags -1 --pretty=%cd --date=short
OUTPUT_VARIABLE APPDATA_RELEASE_DATE
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
file(TIMESTAMP "${CMAKE_SOURCE_DIR}/CMakeLists.txt" APPDATA_RELEASE_DATE
"%Y-%m-%d")
endif()
endif()
configure_file(
com.obsproject.Studio.appdata.xml.in
com.obsproject.Studio.appdata.xml)
configure_file(com.obsproject.Studio.appdata.xml.in
com.obsproject.Studio.appdata.xml)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/com.obsproject.Studio.appdata.xml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
install(FILES com.obsproject.Studio.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
# Icons
install(
FILES icons/obs-logo-128.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps
RENAME com.obsproject.Studio.png)
install(FILES icons/obs-logo-128.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps
RENAME com.obsproject.Studio.png)
install(
FILES icons/obs-logo-256.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps
RENAME com.obsproject.Studio.png)
install(FILES icons/obs-logo-256.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps
RENAME com.obsproject.Studio.png)
install(
FILES icons/obs-logo-512.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps
RENAME com.obsproject.Studio.png)
install(FILES icons/obs-logo-512.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps
RENAME com.obsproject.Studio.png)
install(FILES icons/obs-logo-scalable.svg
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps
RENAME com.obsproject.Studio.svg)
install(
FILES icons/obs-logo-scalable.svg
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps
RENAME com.obsproject.Studio.svg)