yolobs-studio/UI/CMakeLists.txt

427 lines
9.7 KiB
CMake
Raw Normal View History

2016-02-23 23:16:51 +00:00
if(DISABLE_UI)
message(STATUS "UI disabled")
return()
elseif(ENABLE_UI)
set(FIND_MODE REQUIRED)
else()
set(FIND_MODE QUIET)
endif()
2019-07-27 12:47:10 +00:00
if(BROWSER_AVAILABLE_INTERNAL)
add_definitions(-DBROWSER_AVAILABLE)
endif()
2016-10-10 19:01:40 +00:00
add_subdirectory(obs-frontend-api)
# ----------------------------------------------------------------------------
project(obs)
2018-05-29 19:13:02 +00:00
set(DISABLE_UPDATE_MODULE TRUE CACHE BOOL "Disables building the update module")
2017-04-19 19:54:15 +00:00
2019-07-27 12:47:10 +00:00
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")
else()
set(TWITCH_ENABLED TRUE)
2016-02-23 23:16:51 +00:00
endif()
2019-07-27 12:47:10 +00:00
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")
2016-02-23 23:16:51 +00:00
else()
2019-07-27 12:47:10 +00:00
set(RESTREAM_ENABLED TRUE)
2016-02-23 23:16:51 +00:00
endif()
2019-07-27 12:47:10 +00:00
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)
2020-10-01 20:15:25 +00:00
find_package(Qt5Widgets ${FIND_MODE})
2019-07-27 12:47:10 +00:00
find_package(Qt5Svg ${FIND_MODE})
2020-03-25 08:07:22 +00:00
find_package(Qt5Xml ${FIND_MODE})
2019-07-27 12:47:10 +00:00
2017-06-29 19:01:10 +00:00
find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil avformat)
2016-02-23 23:16:51 +00:00
2018-02-19 19:54:37 +00:00
if(APPLE)
find_package(Qt5MacExtras REQUIRED)
endif(APPLE)
2016-02-23 23:16:51 +00:00
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()
2017-06-29 19:01:10 +00:00
include_directories(${FFMPEG_INCLUDE_DIRS})
2019-07-27 12:47:10 +00:00
include_directories(${CMAKE_CURRENT_BINARY_DIR})
2016-10-10 19:01:40 +00:00
include_directories(SYSTEM "obs-frontend-api")
2016-02-23 23:16:51 +00:00
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
2017-06-29 19:01:10 +00:00
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/deps/libff")
2018-12-16 16:14:58 +00:00
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/deps/json11")
2019-07-27 12:47:10 +00:00
if(BROWSER_AVAILABLE_INTERNAL)
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/plugins/obs-browser/panel")
endif()
2016-02-23 23:16:51 +00:00
find_package(Libcurl REQUIRED)
include_directories(${LIBCURL_INCLUDE_DIRS})
add_definitions(${LIBCURL_DEFINITIONS})
if(WIN32)
2017-04-19 19:54:15 +00:00
include_directories(${BLAKE2_INCLUDE_DIR})
2016-02-23 23:16:51 +00:00
set(obs_PLATFORM_SOURCES
platform-windows.cpp
2017-04-19 19:54:15 +00:00
win-update/update-window.cpp
win-update/win-update.cpp
win-update/win-update-helpers.cpp
2019-07-27 12:47:10 +00:00
${obs-studio_BINARY_DIR}/obs.rc)
2017-04-19 19:54:15 +00:00
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
2020-12-22 17:32:50 +00:00
blake2)
2019-07-27 12:47:10 +00:00
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
endif()
2016-02-23 23:16:51 +00:00
elseif(APPLE)
set(obs_PLATFORM_SOURCES
platform-osx.mm)
find_package(AppKit REQUIRED)
set(obs_PLATFORM_LIBRARIES ${APPKIT_LIBRARIES})
add_definitions(-fobjc-arc)
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()
elseif(UNIX)
find_package(Qt5X11Extras REQUIRED)
set(obs_PLATFORM_SOURCES
platform-x11.cpp)
2017-04-19 19:54:15 +00:00
set(obs_PLATFORM_LIBRARIES
2016-02-23 23:16:51 +00:00
Qt5::X11Extras)
2020-12-22 17:32:50 +00:00
if("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
list(APPEND obs_PLATFORM_LIBRARIES
procstat)
endif()
2016-02-23 23:16:51 +00:00
endif()
2019-07-27 12:47:10 +00:00
if(BROWSER_AVAILABLE_INTERNAL)
list(APPEND obs_PLATFORM_SOURCES
obf.c
auth-oauth.cpp
2019-09-22 21:19:10 +00:00
window-dock-browser.cpp
window-extra-browsers.cpp
2019-07-27 12:47:10 +00:00
)
list(APPEND obs_PLATFORM_HEADERS
obf.h
auth-oauth.hpp
2019-09-22 21:19:10 +00:00
window-dock-browser.hpp
window-extra-browsers.hpp
2019-07-27 12:47:10 +00:00
)
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()
2017-06-29 19:01:10 +00:00
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
)
2019-09-22 21:19:10 +00:00
set(obs_PLATFORM_LIBRARIES
${obs_PLATFORM_LIBRARIES}
w32-pthreads)
2017-06-29 19:01:10 +00:00
endif()
2016-02-23 23:16:51 +00:00
set(obs_SOURCES
${obs_PLATFORM_SOURCES}
2017-06-29 19:01:10 +00:00
${obs_libffutil_SOURCES}
2018-12-16 16:14:58 +00:00
../deps/json11/json11.cpp
2016-02-23 23:16:51 +00:00
obs-app.cpp
2019-07-27 12:47:10 +00:00
window-dock.cpp
2016-10-10 19:01:40 +00:00
api-interface.cpp
2016-02-23 23:16:51 +00:00
window-basic-main.cpp
2017-06-29 19:01:10 +00:00
window-basic-stats.cpp
2016-02-23 23:16:51 +00:00
window-basic-filters.cpp
window-basic-settings.cpp
window-basic-interaction.cpp
window-basic-properties.cpp
2017-06-29 19:01:10 +00:00
window-basic-auto-config.cpp
2016-02-23 23:16:51 +00:00
window-basic-main-outputs.cpp
window-basic-source-select.cpp
2019-07-27 12:47:10 +00:00
window-basic-settings-stream.cpp
2020-10-01 20:15:25 +00:00
window-basic-main-screenshot.cpp
2017-06-29 19:01:10 +00:00
window-basic-auto-config-test.cpp
2016-02-23 23:16:51 +00:00
window-basic-main-scene-collections.cpp
window-basic-main-transitions.cpp
2016-10-10 19:01:40 +00:00
window-basic-main-dropfiles.cpp
2016-02-23 23:16:51 +00:00
window-basic-main-profiles.cpp
2019-07-27 12:47:10 +00:00
window-basic-main-browser.cpp
2020-03-25 08:07:22 +00:00
window-basic-main-icons.cpp
2016-02-23 23:16:51 +00:00
window-basic-status-bar.cpp
window-basic-adv-audio.cpp
window-basic-transform.cpp
window-basic-preview.cpp
2019-07-27 12:47:10 +00:00
window-basic-about.cpp
2020-03-25 08:07:22 +00:00
window-importer.cpp
2020-10-01 20:15:25 +00:00
media-controls.cpp
2016-02-23 23:16:51 +00:00
window-namedialog.cpp
window-log-reply.cpp
window-projector.cpp
window-remux.cpp
2019-07-27 12:47:10 +00:00
auth-base.cpp
2018-12-16 16:14:58 +00:00
source-tree.cpp
2020-03-25 08:07:22 +00:00
scene-tree.cpp
2016-02-23 23:16:51 +00:00
properties-view.cpp
focus-list.cpp
menu-button.cpp
double-slider.cpp
2019-07-27 12:47:10 +00:00
slider-ignorewheel.cpp
combobox-ignorewheel.cpp
spinbox-ignorewheel.cpp
2019-09-22 21:19:10 +00:00
record-button.cpp
2020-03-25 08:07:22 +00:00
ui-validation.cpp
url-push-button.cpp
2016-02-23 23:16:51 +00:00
volume-control.cpp
adv-audio-control.cpp
item-widget-helpers.cpp
2020-10-01 20:15:25 +00:00
context-bar-controls.cpp
2018-12-16 16:14:58 +00:00
horizontal-scroll-area.cpp
2016-02-23 23:16:51 +00:00
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
2020-10-01 20:15:25 +00:00
qt-wrappers.cpp
log-viewer.cpp
obs-proxy-style.cpp
locked-checkbox.cpp
visibility-checkbox.cpp
media-slider.cpp)
2016-02-23 23:16:51 +00:00
set(obs_HEADERS
2017-04-19 19:54:15 +00:00
${obs_PLATFORM_HEADERS}
2017-06-29 19:01:10 +00:00
${obs_libffutil_HEADERS}
2018-12-16 16:14:58 +00:00
../deps/json11/json11.hpp
2016-02-23 23:16:51 +00:00
obs-app.hpp
platform.hpp
2019-07-27 12:47:10 +00:00
window-dock.hpp
2016-02-23 23:16:51 +00:00
window-main.hpp
window-basic-main.hpp
2017-06-29 19:01:10 +00:00
window-basic-stats.hpp
2016-02-23 23:16:51 +00:00
window-basic-filters.hpp
window-basic-settings.hpp
window-basic-interaction.hpp
window-basic-properties.hpp
2017-06-29 19:01:10 +00:00
window-basic-auto-config.hpp
2016-02-23 23:16:51 +00:00
window-basic-main-outputs.hpp
window-basic-source-select.hpp
2019-07-27 12:47:10 +00:00
window-basic-about.hpp
2016-02-23 23:16:51 +00:00
window-basic-status-bar.hpp
window-basic-adv-audio.hpp
window-basic-transform.hpp
window-basic-preview.hpp
2020-03-25 08:07:22 +00:00
window-importer.hpp
2020-10-01 20:15:25 +00:00
media-controls.hpp
2016-02-23 23:16:51 +00:00
window-namedialog.hpp
window-log-reply.hpp
window-projector.hpp
window-remux.hpp
2019-07-27 12:47:10 +00:00
auth-base.hpp
2018-12-16 16:14:58 +00:00
source-tree.hpp
2020-03-25 08:07:22 +00:00
scene-tree.hpp
2016-02-23 23:16:51 +00:00
properties-view.hpp
properties-view.moc.hpp
display-helpers.hpp
2019-07-27 12:47:10 +00:00
balance-slider.hpp
2016-02-23 23:16:51 +00:00
double-slider.hpp
2019-07-27 12:47:10 +00:00
slider-ignorewheel.hpp
combobox-ignorewheel.hpp
spinbox-ignorewheel.hpp
2016-02-23 23:16:51 +00:00
focus-list.hpp
menu-button.hpp
mute-checkbox.hpp
2019-09-22 21:19:10 +00:00
record-button.hpp
2020-03-25 08:07:22 +00:00
ui-validation.hpp
2020-10-01 20:15:25 +00:00
screenshot-obj.hpp
2020-03-25 08:07:22 +00:00
url-push-button.hpp
2016-02-23 23:16:51 +00:00
volume-control.hpp
adv-audio-control.hpp
item-widget-helpers.hpp
visibility-checkbox.hpp
2020-10-01 20:15:25 +00:00
context-bar-controls.hpp
2018-02-19 19:54:37 +00:00
locked-checkbox.hpp
2018-12-16 16:14:58 +00:00
horizontal-scroll-area.hpp
expand-checkbox.hpp
2016-02-23 23:16:51 +00:00
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
2019-07-27 12:47:10 +00:00
qt-wrappers.hpp
2020-10-01 20:15:25 +00:00
clickable-label.hpp
log-viewer.hpp
obs-proxy-style.hpp
obs-proxy-style.hpp
media-slider.hpp)
2016-02-23 23:16:51 +00:00
2020-03-25 08:07:22 +00:00
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})
2016-02-23 23:16:51 +00:00
set(obs_UI
2020-10-01 20:15:25 +00:00
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
2017-06-29 19:01:10 +00:00
forms/AutoConfigStartPage.ui
forms/AutoConfigVideoPage.ui
forms/AutoConfigStreamPage.ui
forms/AutoConfigTestPage.ui
2018-12-16 16:14:58 +00:00
forms/ColorSelect.ui
2016-02-23 23:16:51 +00:00
forms/OBSLogReply.ui
forms/OBSBasic.ui
forms/OBSBasicTransform.ui
forms/OBSBasicFilters.ui
forms/OBSBasicSettings.ui
forms/OBSBasicSourceSelect.ui
forms/OBSBasicInteraction.ui
2019-09-22 21:19:10 +00:00
forms/OBSExtraBrowsers.ui
2017-04-19 19:54:15 +00:00
forms/OBSUpdate.ui
2019-07-27 12:47:10 +00:00
forms/OBSRemux.ui
2020-03-25 08:07:22 +00:00
forms/OBSImporter.ui
2019-07-27 12:47:10 +00:00
forms/OBSAbout.ui)
2016-02-23 23:16:51 +00:00
set(obs_QRC
forms/obs.qrc)
qt5_wrap_ui(obs_UI_HEADERS ${obs_UI})
qt5_add_resources(obs_QRC_SOURCES ${obs_QRC})
add_executable(obs WIN32
2020-03-25 08:07:22 +00:00
obs.manifest
2016-02-23 23:16:51 +00:00
${obs_SOURCES}
${obs_HEADERS}
2020-03-25 08:07:22 +00:00
${obs_importers_SOURCES}
${obs_importers_HEADERS}
2016-02-23 23:16:51 +00:00
${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}")
endif()
target_link_libraries(obs
libobs
Qt5::Widgets
2019-07-27 12:47:10 +00:00
Qt5::Svg
2020-03-25 08:07:22 +00:00
Qt5::Xml
2016-10-10 19:01:40 +00:00
obs-frontend-api
2017-06-29 19:01:10 +00:00
${FFMPEG_LIBRARIES}
2016-02-23 23:16:51 +00:00
${LIBCURL_LIBRARIES}
${obs_PLATFORM_LIBRARIES})
2018-02-19 19:54:37 +00:00
if (APPLE)
target_link_libraries(obs
Qt5::MacExtras)
set_target_properties(obs PROPERTIES LINK_FLAGS "-pagezero_size 10000 -image_base 100000000")
endif()
2020-10-01 20:15:25 +00:00
set_target_properties(obs PROPERTIES FOLDER "frontend")
2018-02-19 19:54:37 +00:00
2016-02-23 23:16:51 +00:00
define_graphic_modules(obs)
install_obs_core(obs)
install_obs_data(obs data obs-studio)
2019-07-27 12:47:10 +00:00
install_obs_data_file(obs ../AUTHORS obs-studio/authors)
2016-02-23 23:16:51 +00:00
if (UNIX AND UNIX_STRUCTURE AND NOT APPLE)
2019-07-27 12:47:10 +00:00
add_subdirectory(xdg-data)
2016-02-23 23:16:51 +00:00
endif()
2016-10-10 19:01:40 +00:00
add_subdirectory(frontend-plugins)
2017-04-19 19:54:15 +00:00
if(WIN32)
add_subdirectory(win-update/updater)
endif()