legacy.cmake 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. add_subdirectory(obs-frontend-api)
  2. option(ENABLE_UI "Enable building with UI (requires Qt)" ON)
  3. if(NOT ENABLE_UI)
  4. obs_status(DISABLED "OBS UI")
  5. return()
  6. endif()
  7. project(obs)
  8. # Legacy support
  9. if(TARGET obs-browser
  10. AND NOT TARGET OBS::browser-panels
  11. AND BROWSER_PANEL_SUPPORT_ENABLED)
  12. add_library(obs-browser-panels INTERFACE)
  13. add_library(OBS::browser-panels ALIAS obs-browser-panels)
  14. target_include_directories(obs-browser-panels INTERFACE ${CMAKE_SOURCE_DIR}/plugins/obs-browser/panel)
  15. endif()
  16. set(OAUTH_BASE_URL
  17. "https://auth.obsproject.com/"
  18. CACHE STRING "Default OAuth base URL")
  19. mark_as_advanced(OAUTH_BASE_URL)
  20. if(NOT DEFINED TWITCH_CLIENTID
  21. OR "${TWITCH_CLIENTID}" STREQUAL ""
  22. OR NOT DEFINED TWITCH_HASH
  23. OR "${TWITCH_HASH}" STREQUAL ""
  24. OR NOT TARGET OBS::browser-panels)
  25. set(TWITCH_ENABLED OFF)
  26. set(TWITCH_CLIENTID "")
  27. set(TWITCH_HASH "0")
  28. else()
  29. set(TWITCH_ENABLED ON)
  30. endif()
  31. if(NOT DEFINED RESTREAM_CLIENTID
  32. OR "${RESTREAM_CLIENTID}" STREQUAL ""
  33. OR NOT DEFINED RESTREAM_HASH
  34. OR "${RESTREAM_HASH}" STREQUAL ""
  35. OR NOT TARGET OBS::browser-panels)
  36. set(RESTREAM_ENABLED OFF)
  37. set(RESTREAM_CLIENTID "")
  38. set(RESTREAM_HASH "0")
  39. else()
  40. set(RESTREAM_ENABLED ON)
  41. endif()
  42. if(NOT DEFINED YOUTUBE_CLIENTID
  43. OR "${YOUTUBE_CLIENTID}" STREQUAL ""
  44. OR NOT DEFINED YOUTUBE_SECRET
  45. OR "${YOUTUBE_SECRET}" STREQUAL ""
  46. OR NOT DEFINED YOUTUBE_CLIENTID_HASH
  47. OR "${YOUTUBE_CLIENTID_HASH}" STREQUAL ""
  48. OR NOT DEFINED YOUTUBE_SECRET_HASH
  49. OR "${YOUTUBE_SECRET_HASH}" STREQUAL "")
  50. set(YOUTUBE_SECRET_HASH "0")
  51. set(YOUTUBE_CLIENTID_HASH "0")
  52. set(YOUTUBE_ENABLED OFF)
  53. else()
  54. set(YOUTUBE_ENABLED ON)
  55. endif()
  56. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ui-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/ui-config.h)
  57. find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil avformat)
  58. find_package(CURL REQUIRED)
  59. add_subdirectory(frontend-plugins)
  60. add_executable(obs)
  61. if(NOT TARGET OBS::properties-view)
  62. add_subdirectory("${CMAKE_SOURCE_DIR}/shared/properties-view" "${CMAKE_BINARY_DIR}/shared/properties-view")
  63. endif()
  64. if(NOT TARGET OBS::qt-plain-text-edit)
  65. add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/plain-text-edit" "${CMAKE_BINARY_DIR}/shared/qt/plain-text-edit")
  66. endif()
  67. if(NOT TARGET OBS::qt-slider-ignorewheel)
  68. add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/slider-ignorewheel"
  69. "${CMAKE_BINARY_DIR}/shared/qt/slider-ignorewheel")
  70. endif()
  71. if(NOT TARGET OBS::qt-vertical-scroll-area)
  72. add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/vertical-scroll-area"
  73. "${CMAKE_BINARY_DIR}/shared/qt/vertical-scroll-area")
  74. endif()
  75. if(NOT TARGET OBS::qt-wrappers)
  76. add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers")
  77. endif()
  78. find_qt(COMPONENTS Widgets Network Svg Xml COMPONENTS_LINUX Gui DBus)
  79. target_link_libraries(obs PRIVATE Qt::Widgets Qt::Svg Qt::Xml Qt::Network)
  80. set_target_properties(
  81. obs
  82. PROPERTIES AUTOMOC ON
  83. AUTOUIC ON
  84. AUTORCC ON
  85. AUTOUIC_SEARCH_PATHS "forms;forms/source-toolbar")
  86. if(OS_WINDOWS)
  87. set_target_properties(obs PROPERTIES AUTORCC_OPTIONS "--format-version;1")
  88. endif()
  89. target_include_directories(obs PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
  90. target_sources(obs PRIVATE forms/obs.qrc)
  91. target_sources(
  92. obs
  93. PRIVATE forms/AutoConfigFinishPage.ui
  94. forms/AutoConfigStartPage.ui
  95. forms/AutoConfigStartPage.ui
  96. forms/AutoConfigStreamPage.ui
  97. forms/AutoConfigTestPage.ui
  98. forms/AutoConfigVideoPage.ui
  99. forms/ColorSelect.ui
  100. forms/OBSAbout.ui
  101. forms/OBSAdvAudio.ui
  102. forms/OBSBasic.ui
  103. forms/OBSBasicControls.ui
  104. forms/OBSBasicFilters.ui
  105. forms/OBSBasicInteraction.ui
  106. forms/OBSBasicProperties.ui
  107. forms/OBSBasicSettings.ui
  108. forms/OBSBasicSourceSelect.ui
  109. forms/OBSBasicTransform.ui
  110. forms/OBSBasicVCamConfig.ui
  111. forms/OBSExtraBrowsers.ui
  112. forms/OBSImporter.ui
  113. forms/OBSLogReply.ui
  114. forms/OBSLogViewer.ui
  115. forms/OBSMissingFiles.ui
  116. forms/OBSRemux.ui
  117. forms/OBSUpdate.ui
  118. forms/OBSYoutubeActions.ui
  119. forms/StatusBarWidget.ui
  120. forms/source-toolbar/browser-source-toolbar.ui
  121. forms/source-toolbar/color-source-toolbar.ui
  122. forms/source-toolbar/device-select-toolbar.ui
  123. forms/source-toolbar/game-capture-toolbar.ui
  124. forms/source-toolbar/image-source-toolbar.ui
  125. forms/source-toolbar/media-controls.ui
  126. forms/source-toolbar/text-source-toolbar.ui)
  127. target_sources(
  128. obs
  129. PRIVATE auth-oauth.cpp
  130. auth-oauth.hpp
  131. auth-listener.cpp
  132. auth-listener.hpp
  133. obf.c
  134. obf.h
  135. obs-app-theming.cpp
  136. obs-app-theming.hpp
  137. obs-app.cpp
  138. obs-app.hpp
  139. obs-proxy-style.cpp
  140. obs-proxy-style.hpp
  141. api-interface.cpp
  142. auth-base.cpp
  143. auth-base.hpp
  144. display-helpers.hpp
  145. platform.hpp
  146. qt-display.cpp
  147. qt-display.hpp
  148. ui-validation.cpp
  149. ui-validation.hpp
  150. multiview.cpp
  151. multiview.hpp
  152. ffmpeg-utils.cpp
  153. ffmpeg-utils.hpp
  154. ${CMAKE_SOURCE_DIR}/deps/json11/json11.cpp
  155. ${CMAKE_SOURCE_DIR}/deps/json11/json11.hpp
  156. ${CMAKE_CURRENT_BINARY_DIR}/ui-config.h)
  157. target_sources(
  158. obs
  159. PRIVATE absolute-slider.cpp
  160. absolute-slider.hpp
  161. adv-audio-control.cpp
  162. adv-audio-control.hpp
  163. audio-encoders.cpp
  164. audio-encoders.hpp
  165. balance-slider.hpp
  166. basic-controls.cpp
  167. basic-controls.hpp
  168. clickable-label.hpp
  169. horizontal-scroll-area.cpp
  170. horizontal-scroll-area.hpp
  171. item-widget-helpers.cpp
  172. item-widget-helpers.hpp
  173. context-bar-controls.cpp
  174. context-bar-controls.hpp
  175. focus-list.cpp
  176. focus-list.hpp
  177. hotkey-edit.cpp
  178. hotkey-edit.hpp
  179. lineedit-autoresize.cpp
  180. lineedit-autoresize.hpp
  181. log-viewer.cpp
  182. log-viewer.hpp
  183. media-controls.cpp
  184. media-controls.hpp
  185. menu-button.cpp
  186. menu-button.hpp
  187. mute-checkbox.hpp
  188. noncheckable-button.hpp
  189. remote-text.cpp
  190. remote-text.hpp
  191. scene-tree.cpp
  192. scene-tree.hpp
  193. screenshot-obj.hpp
  194. source-label.cpp
  195. source-label.hpp
  196. source-tree.cpp
  197. source-tree.hpp
  198. url-push-button.cpp
  199. url-push-button.hpp
  200. undo-stack-obs.cpp
  201. undo-stack-obs.hpp
  202. volume-control.cpp
  203. volume-control.hpp
  204. visibility-item-widget.cpp
  205. visibility-item-widget.hpp)
  206. target_sources(
  207. obs
  208. PRIVATE window-basic-about.cpp
  209. window-basic-about.hpp
  210. window-basic-auto-config.cpp
  211. window-basic-auto-config.hpp
  212. window-basic-auto-config-test.cpp
  213. window-basic-adv-audio.cpp
  214. window-basic-adv-audio.hpp
  215. window-basic-filters.cpp
  216. window-basic-filters.hpp
  217. window-basic-interaction.cpp
  218. window-basic-interaction.hpp
  219. window-basic-main.cpp
  220. window-basic-main.hpp
  221. window-basic-main-browser.cpp
  222. window-basic-main-dropfiles.cpp
  223. window-basic-main-icons.cpp
  224. window-basic-main-outputs.cpp
  225. window-basic-main-outputs.hpp
  226. window-basic-main-profiles.cpp
  227. window-basic-main-scene-collections.cpp
  228. window-basic-main-screenshot.cpp
  229. window-basic-main-transitions.cpp
  230. window-basic-preview.cpp
  231. window-basic-properties.cpp
  232. window-basic-properties.hpp
  233. window-basic-settings.cpp
  234. window-basic-settings.hpp
  235. window-basic-settings-a11y.cpp
  236. window-basic-settings-appearance.cpp
  237. window-basic-settings-stream.cpp
  238. window-basic-source-select.cpp
  239. window-basic-source-select.hpp
  240. window-basic-stats.cpp
  241. window-basic-stats.hpp
  242. window-basic-status-bar.cpp
  243. window-basic-status-bar.hpp
  244. window-basic-transform.cpp
  245. window-basic-transform.hpp
  246. window-basic-preview.hpp
  247. window-basic-vcam.hpp
  248. window-basic-vcam-config.cpp
  249. window-basic-vcam-config.hpp
  250. window-dock.cpp
  251. window-dock.hpp
  252. window-importer.cpp
  253. window-importer.hpp
  254. window-log-reply.hpp
  255. window-main.hpp
  256. window-missing-files.cpp
  257. window-missing-files.hpp
  258. window-namedialog.cpp
  259. window-namedialog.hpp
  260. window-log-reply.cpp
  261. window-projector.cpp
  262. window-projector.hpp
  263. window-remux.cpp
  264. window-remux.hpp)
  265. target_sources(
  266. obs
  267. PRIVATE # cmake-format: sortable
  268. goliveapi-censoredjson.cpp
  269. goliveapi-censoredjson.hpp
  270. goliveapi-network.cpp
  271. goliveapi-network.hpp
  272. goliveapi-postdata.cpp
  273. goliveapi-postdata.hpp
  274. multitrack-video-error.cpp
  275. multitrack-video-error.hpp
  276. multitrack-video-output.cpp
  277. multitrack-video-output.hpp
  278. system-info.hpp)
  279. target_sources(obs PRIVATE importers/importers.cpp importers/importers.hpp importers/classic.cpp importers/sl.cpp
  280. importers/studio.cpp importers/xsplit.cpp)
  281. target_compile_features(obs PRIVATE cxx_std_17)
  282. target_include_directories(obs PRIVATE ${CMAKE_SOURCE_DIR}/deps/json11)
  283. target_link_libraries(
  284. obs
  285. PRIVATE CURL::libcurl
  286. FFmpeg::avcodec
  287. FFmpeg::avutil
  288. FFmpeg::avformat
  289. OBS::libobs
  290. OBS::frontend-api
  291. OBS::qt-wrappers
  292. OBS::qt-plain-text-edit
  293. OBS::qt-vertical-scroll-area
  294. OBS::qt-slider-ignorewheel
  295. OBS::properties-view)
  296. set_target_properties(obs PROPERTIES FOLDER "frontend")
  297. if(TARGET OBS::browser-panels)
  298. get_target_property(_PANEL_INCLUDE_DIRECTORY OBS::browser-panels INTERFACE_INCLUDE_DIRECTORIES)
  299. target_include_directories(obs PRIVATE ${_PANEL_INCLUDE_DIRECTORY})
  300. target_compile_definitions(obs PRIVATE BROWSER_AVAILABLE)
  301. target_sources(obs PRIVATE window-dock-browser.cpp window-dock-browser.hpp window-extra-browsers.cpp
  302. window-extra-browsers.hpp)
  303. if(TWITCH_ENABLED)
  304. target_compile_definitions(obs PRIVATE TWITCH_ENABLED)
  305. target_sources(obs PRIVATE auth-twitch.cpp auth-twitch.hpp)
  306. endif()
  307. if(RESTREAM_ENABLED)
  308. target_compile_definitions(obs PRIVATE RESTREAM_ENABLED)
  309. target_sources(obs PRIVATE auth-restream.cpp auth-restream.hpp)
  310. endif()
  311. if(OS_WINDOWS OR OS_MACOS)
  312. set(ENABLE_WHATSNEW
  313. ON
  314. CACHE INTERNAL "Enable WhatsNew dialog")
  315. elseif(OS_LINUX)
  316. option(ENABLE_WHATSNEW "Enable WhatsNew dialog" ON)
  317. endif()
  318. if(ENABLE_WHATSNEW)
  319. target_compile_definitions(obs PRIVATE WHATSNEW_ENABLED)
  320. endif()
  321. endif()
  322. if(YOUTUBE_ENABLED)
  323. target_compile_definitions(obs PRIVATE YOUTUBE_ENABLED)
  324. target_sources(
  325. obs
  326. PRIVATE auth-youtube.cpp
  327. auth-youtube.hpp
  328. window-dock-youtube-app.cpp
  329. window-dock-youtube-app.hpp
  330. window-youtube-actions.cpp
  331. window-youtube-actions.hpp
  332. youtube-api-wrappers.cpp
  333. youtube-api-wrappers.hpp)
  334. endif()
  335. if(OS_WINDOWS)
  336. set_target_properties(obs PROPERTIES WIN32_EXECUTABLE ON OUTPUT_NAME "obs${_ARCH_SUFFIX}")
  337. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/obs.rc.in ${CMAKE_BINARY_DIR}/obs.rc)
  338. find_package(Detours REQUIRED)
  339. find_package(nlohmann_json REQUIRED)
  340. target_sources(
  341. obs
  342. PRIVATE obs.manifest
  343. platform-windows.cpp
  344. win-dll-blocklist.c
  345. update/update-window.cpp
  346. update/update-window.hpp
  347. update/win-update.cpp
  348. update/win-update.hpp
  349. update/shared-update.cpp
  350. update/shared-update.hpp
  351. update/update-helpers.cpp
  352. update/update-helpers.hpp
  353. update/crypto-helpers-mbedtls.cpp
  354. update/crypto-helpers.hpp
  355. update/models/branches.hpp
  356. update/models/whatsnew.hpp
  357. win-update/updater/manifest.hpp
  358. ${CMAKE_BINARY_DIR}/obs.rc)
  359. target_sources(obs PRIVATE system-info-windows.cpp)
  360. find_package(MbedTLS)
  361. target_link_libraries(obs PRIVATE Mbedtls::Mbedtls nlohmann_json::nlohmann_json OBS::blake2 Detours::Detours)
  362. target_compile_features(obs PRIVATE cxx_std_17)
  363. target_compile_definitions(obs PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS
  364. PSAPI_VERSION=2)
  365. set_source_files_properties(update/win-update.cpp PROPERTIES COMPILE_DEFINITIONS OBS_COMMIT="${OBS_COMMIT}")
  366. if(MSVC)
  367. target_link_options(obs PRIVATE "LINKER:/IGNORE:4098" "LINKER:/IGNORE:4099")
  368. target_link_libraries(obs PRIVATE OBS::w32-pthreads)
  369. endif()
  370. if(CMAKE_SIZEOF_VOID_P EQUAL 4)
  371. target_link_options(obs PRIVATE /LARGEADDRESSAWARE)
  372. endif()
  373. add_subdirectory(win-update/updater)
  374. elseif(OS_MACOS)
  375. set_target_properties(
  376. obs
  377. PROPERTIES OUTPUT_NAME ${OBS_BUNDLE_NAME}
  378. MACOSX_BUNDLE ON
  379. MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/Info.plist.in)
  380. if(XCODE)
  381. set_target_properties(
  382. obs
  383. PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}"
  384. XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon
  385. XCODE_ATTRIBUTE_PRODUCT_NAME "OBS")
  386. set(APP_ICON_TARGET ${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/Assets.xcassets)
  387. target_sources(obs PRIVATE ${APP_ICON_TARGET})
  388. set_source_files_properties(${APP_ICON_TARGET} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
  389. else()
  390. set(APP_ICON_TARGET ${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/AppIcon.iconset)
  391. set(APP_ICON_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/AppIcon.icns)
  392. add_custom_command(OUTPUT ${APP_ICON_OUTPUT} COMMAND iconutil -c icns "${APP_ICON_TARGET}" -o "${APP_ICON_OUTPUT}")
  393. set(MACOSX_BUNDLE_ICON_FILE AppIcon.icns)
  394. target_sources(obs PRIVATE ${APP_ICON_OUTPUT} ${CMAKE_CURRENT_SOURCE_DIR}/../AUTHORS)
  395. set_source_files_properties(${APP_ICON_OUTPUT} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
  396. endif()
  397. find_library(APPKIT Appkit)
  398. find_library(AVFOUNDATION AVFoundation)
  399. find_library(APPLICATIONSERVICES ApplicationServices)
  400. mark_as_advanced(APPKIT AVFOUNDATION APPLICATIONSERVICES)
  401. target_link_libraries(obs PRIVATE ${APPKIT} ${AVFOUNDATION} ${APPLICATIONSERVICES})
  402. target_sources(obs PRIVATE platform-osx.mm)
  403. target_sources(obs PRIVATE forms/OBSPermissions.ui window-permissions.cpp window-permissions.hpp)
  404. target_sources(obs PRIVATE system-info-macos.mm)
  405. if(ENABLE_WHATSNEW)
  406. find_library(SECURITY Security)
  407. find_package(nlohmann_json REQUIRED)
  408. mark_as_advanced(SECURITY)
  409. target_link_libraries(obs PRIVATE ${SECURITY} OBS::blake2 nlohmann_json::nlohmann_json)
  410. target_sources(
  411. obs
  412. PRIVATE update/crypto-helpers.hpp
  413. update/crypto-helpers-mac.mm
  414. update/shared-update.cpp
  415. update/shared-update.hpp
  416. update/update-helpers.cpp
  417. update/update-helpers.hpp
  418. update/models/whatsnew.hpp)
  419. if(SPARKLE_APPCAST_URL AND SPARKLE_PUBLIC_KEY)
  420. find_library(SPARKLE Sparkle)
  421. mark_as_advanced(SPARKLE)
  422. target_sources(obs PRIVATE update/mac-update.cpp update/mac-update.hpp update/sparkle-updater.mm
  423. update/models/branches.hpp)
  424. target_compile_definitions(obs PRIVATE ENABLE_SPARKLE_UPDATER)
  425. target_link_libraries(obs PRIVATE ${SPARKLE})
  426. # Enable Automatic Reference Counting for Sparkle wrapper
  427. set_source_files_properties(update/sparkle-updater.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
  428. endif()
  429. endif()
  430. set_source_files_properties(platform-osx.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
  431. elseif(OS_POSIX)
  432. target_sources(obs PRIVATE platform-x11.cpp)
  433. target_link_libraries(obs PRIVATE Qt::GuiPrivate Qt::DBus)
  434. target_sources(obs PRIVATE system-info-posix.cpp)
  435. target_compile_definitions(obs PRIVATE OBS_INSTALL_PREFIX="${OBS_INSTALL_PREFIX}"
  436. "$<$<BOOL:${LINUX_PORTABLE}>:LINUX_PORTABLE>")
  437. if(TARGET obspython)
  438. find_package(Python REQUIRED COMPONENTS Interpreter Development)
  439. target_link_libraries(obs PRIVATE Python::Python)
  440. target_link_options(obs PRIVATE "LINKER:-no-as-needed")
  441. endif()
  442. if(NOT LINUX_PORTABLE)
  443. add_subdirectory(xdg-data)
  444. endif()
  445. if(OS_FREEBSD)
  446. target_link_libraries(obs PRIVATE procstat)
  447. target_compile_options(obs PRIVATE -Wno-unqualified-std-cast-call)
  448. endif()
  449. if(OS_LINUX)
  450. if(USE_XDG)
  451. target_compile_definitions(obs PRIVATE USE_XDG)
  452. endif()
  453. if(ENABLE_WHATSNEW)
  454. find_package(MbedTLS)
  455. find_package(nlohmann_json REQUIRED)
  456. if(NOT MBEDTLS_FOUND)
  457. obs_status(FATAL_ERROR "mbedTLS not found, but required for WhatsNew support on Linux")
  458. endif()
  459. target_sources(obs PRIVATE update/crypto-helpers.hpp update/crypto-helpers-mbedtls.cpp update/shared-update.cpp
  460. update/shared-update.hpp update/update-helpers.cpp update/update-helpers.hpp)
  461. target_link_libraries(obs PRIVATE Mbedtls::Mbedtls nlohmann_json::nlohmann_json OBS::blake2)
  462. endif()
  463. endif()
  464. endif()
  465. get_target_property(_SOURCES obs SOURCES)
  466. set(_UI ${_SOURCES})
  467. list(FILTER _UI INCLUDE REGEX ".*\\.ui?")
  468. source_group(
  469. TREE "${CMAKE_CURRENT_SOURCE_DIR}/forms"
  470. PREFIX "UI Files"
  471. FILES ${_UI})
  472. unset(_SOURCES)
  473. unset(_UI)
  474. get_property(OBS_MODULE_LIST GLOBAL PROPERTY OBS_MODULE_LIST)
  475. list(JOIN OBS_MODULE_LIST "|" SAFE_MODULES)
  476. target_compile_definitions(obs PRIVATE "SAFE_MODULES=\"${SAFE_MODULES}\"")
  477. define_graphic_modules(obs)
  478. setup_obs_app(obs)
  479. setup_target_resources(obs obs-studio)
  480. add_target_resource(obs ${CMAKE_CURRENT_SOURCE_DIR}/../AUTHORS obs-studio/authors)