legacy.cmake 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  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. preview-controls.cpp
  190. preview-controls.hpp
  191. remote-text.cpp
  192. remote-text.hpp
  193. scene-tree.cpp
  194. scene-tree.hpp
  195. screenshot-obj.hpp
  196. source-label.cpp
  197. source-label.hpp
  198. source-tree.cpp
  199. source-tree.hpp
  200. url-push-button.cpp
  201. url-push-button.hpp
  202. undo-stack-obs.cpp
  203. undo-stack-obs.hpp
  204. volume-control.cpp
  205. volume-control.hpp
  206. visibility-item-widget.cpp
  207. visibility-item-widget.hpp)
  208. target_sources(
  209. obs
  210. PRIVATE window-basic-about.cpp
  211. window-basic-about.hpp
  212. window-basic-auto-config.cpp
  213. window-basic-auto-config.hpp
  214. window-basic-auto-config-test.cpp
  215. window-basic-adv-audio.cpp
  216. window-basic-adv-audio.hpp
  217. window-basic-filters.cpp
  218. window-basic-filters.hpp
  219. window-basic-interaction.cpp
  220. window-basic-interaction.hpp
  221. window-basic-main.cpp
  222. window-basic-main.hpp
  223. window-basic-main-browser.cpp
  224. window-basic-main-dropfiles.cpp
  225. window-basic-main-icons.cpp
  226. window-basic-main-outputs.cpp
  227. window-basic-main-outputs.hpp
  228. window-basic-main-profiles.cpp
  229. window-basic-main-scene-collections.cpp
  230. window-basic-main-screenshot.cpp
  231. window-basic-main-transitions.cpp
  232. window-basic-preview.cpp
  233. window-basic-properties.cpp
  234. window-basic-properties.hpp
  235. window-basic-settings.cpp
  236. window-basic-settings.hpp
  237. window-basic-settings-a11y.cpp
  238. window-basic-settings-appearance.cpp
  239. window-basic-settings-stream.cpp
  240. window-basic-source-select.cpp
  241. window-basic-source-select.hpp
  242. window-basic-stats.cpp
  243. window-basic-stats.hpp
  244. window-basic-status-bar.cpp
  245. window-basic-status-bar.hpp
  246. window-basic-transform.cpp
  247. window-basic-transform.hpp
  248. window-basic-preview.hpp
  249. window-basic-vcam.hpp
  250. window-basic-vcam-config.cpp
  251. window-basic-vcam-config.hpp
  252. window-dock.cpp
  253. window-dock.hpp
  254. window-importer.cpp
  255. window-importer.hpp
  256. window-log-reply.hpp
  257. window-main.hpp
  258. window-missing-files.cpp
  259. window-missing-files.hpp
  260. window-namedialog.cpp
  261. window-namedialog.hpp
  262. window-log-reply.cpp
  263. window-projector.cpp
  264. window-projector.hpp
  265. window-remux.cpp
  266. window-remux.hpp)
  267. target_sources(
  268. obs
  269. PRIVATE # cmake-format: sortable
  270. goliveapi-censoredjson.cpp
  271. goliveapi-censoredjson.hpp
  272. goliveapi-network.cpp
  273. goliveapi-network.hpp
  274. goliveapi-postdata.cpp
  275. goliveapi-postdata.hpp
  276. multitrack-video-error.cpp
  277. multitrack-video-error.hpp
  278. multitrack-video-output.cpp
  279. multitrack-video-output.hpp
  280. system-info.hpp)
  281. target_sources(obs PRIVATE importers/importers.cpp importers/importers.hpp importers/classic.cpp importers/sl.cpp
  282. importers/studio.cpp importers/xsplit.cpp)
  283. target_compile_features(obs PRIVATE cxx_std_17)
  284. target_include_directories(obs PRIVATE ${CMAKE_SOURCE_DIR}/deps/json11)
  285. target_link_libraries(
  286. obs
  287. PRIVATE CURL::libcurl
  288. FFmpeg::avcodec
  289. FFmpeg::avutil
  290. FFmpeg::avformat
  291. OBS::libobs
  292. OBS::frontend-api
  293. OBS::qt-wrappers
  294. OBS::qt-plain-text-edit
  295. OBS::qt-vertical-scroll-area
  296. OBS::qt-slider-ignorewheel
  297. OBS::properties-view)
  298. set_target_properties(obs PROPERTIES FOLDER "frontend")
  299. if(TARGET OBS::browser-panels)
  300. get_target_property(_PANEL_INCLUDE_DIRECTORY OBS::browser-panels INTERFACE_INCLUDE_DIRECTORIES)
  301. target_include_directories(obs PRIVATE ${_PANEL_INCLUDE_DIRECTORY})
  302. target_compile_definitions(obs PRIVATE BROWSER_AVAILABLE)
  303. target_sources(obs PRIVATE window-dock-browser.cpp window-dock-browser.hpp window-extra-browsers.cpp
  304. window-extra-browsers.hpp)
  305. if(TWITCH_ENABLED)
  306. target_compile_definitions(obs PRIVATE TWITCH_ENABLED)
  307. target_sources(obs PRIVATE auth-twitch.cpp auth-twitch.hpp)
  308. endif()
  309. if(RESTREAM_ENABLED)
  310. target_compile_definitions(obs PRIVATE RESTREAM_ENABLED)
  311. target_sources(obs PRIVATE auth-restream.cpp auth-restream.hpp)
  312. endif()
  313. if(OS_WINDOWS OR OS_MACOS)
  314. set(ENABLE_WHATSNEW
  315. ON
  316. CACHE INTERNAL "Enable WhatsNew dialog")
  317. elseif(OS_LINUX)
  318. option(ENABLE_WHATSNEW "Enable WhatsNew dialog" ON)
  319. endif()
  320. if(ENABLE_WHATSNEW)
  321. target_compile_definitions(obs PRIVATE WHATSNEW_ENABLED)
  322. endif()
  323. endif()
  324. if(YOUTUBE_ENABLED)
  325. target_compile_definitions(obs PRIVATE YOUTUBE_ENABLED)
  326. target_sources(
  327. obs
  328. PRIVATE auth-youtube.cpp
  329. auth-youtube.hpp
  330. window-dock-youtube-app.cpp
  331. window-dock-youtube-app.hpp
  332. window-youtube-actions.cpp
  333. window-youtube-actions.hpp
  334. youtube-api-wrappers.cpp
  335. youtube-api-wrappers.hpp)
  336. endif()
  337. if(OS_WINDOWS)
  338. set_target_properties(obs PROPERTIES WIN32_EXECUTABLE ON OUTPUT_NAME "obs${_ARCH_SUFFIX}")
  339. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/obs.rc.in ${CMAKE_BINARY_DIR}/obs.rc)
  340. find_package(Detours REQUIRED)
  341. find_package(nlohmann_json REQUIRED)
  342. target_sources(
  343. obs
  344. PRIVATE obs.manifest
  345. platform-windows.cpp
  346. win-dll-blocklist.c
  347. update/update-window.cpp
  348. update/update-window.hpp
  349. update/win-update.cpp
  350. update/win-update.hpp
  351. update/shared-update.cpp
  352. update/shared-update.hpp
  353. update/update-helpers.cpp
  354. update/update-helpers.hpp
  355. update/crypto-helpers-mbedtls.cpp
  356. update/crypto-helpers.hpp
  357. update/models/branches.hpp
  358. update/models/whatsnew.hpp
  359. win-update/updater/manifest.hpp
  360. ${CMAKE_BINARY_DIR}/obs.rc)
  361. target_sources(obs PRIVATE system-info-windows.cpp)
  362. find_package(MbedTLS)
  363. target_link_libraries(obs PRIVATE Mbedtls::Mbedtls nlohmann_json::nlohmann_json OBS::blake2 Detours::Detours)
  364. target_compile_features(obs PRIVATE cxx_std_17)
  365. target_compile_definitions(obs PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS
  366. PSAPI_VERSION=2)
  367. set_source_files_properties(update/win-update.cpp PROPERTIES COMPILE_DEFINITIONS OBS_COMMIT="${OBS_COMMIT}")
  368. if(MSVC)
  369. target_link_options(obs PRIVATE "LINKER:/IGNORE:4098" "LINKER:/IGNORE:4099")
  370. target_link_libraries(obs PRIVATE OBS::w32-pthreads)
  371. endif()
  372. if(CMAKE_SIZEOF_VOID_P EQUAL 4)
  373. target_link_options(obs PRIVATE /LARGEADDRESSAWARE)
  374. endif()
  375. add_subdirectory(win-update/updater)
  376. elseif(OS_MACOS)
  377. set_target_properties(
  378. obs
  379. PROPERTIES OUTPUT_NAME ${OBS_BUNDLE_NAME}
  380. MACOSX_BUNDLE ON
  381. MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/Info.plist.in)
  382. if(XCODE)
  383. set_target_properties(
  384. obs
  385. PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}"
  386. XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon
  387. XCODE_ATTRIBUTE_PRODUCT_NAME "OBS")
  388. set(APP_ICON_TARGET ${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/Assets.xcassets)
  389. target_sources(obs PRIVATE ${APP_ICON_TARGET})
  390. set_source_files_properties(${APP_ICON_TARGET} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
  391. else()
  392. set(APP_ICON_TARGET ${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/AppIcon.iconset)
  393. set(APP_ICON_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/AppIcon.icns)
  394. add_custom_command(OUTPUT ${APP_ICON_OUTPUT} COMMAND iconutil -c icns "${APP_ICON_TARGET}" -o "${APP_ICON_OUTPUT}")
  395. set(MACOSX_BUNDLE_ICON_FILE AppIcon.icns)
  396. target_sources(obs PRIVATE ${APP_ICON_OUTPUT} ${CMAKE_CURRENT_SOURCE_DIR}/../AUTHORS)
  397. set_source_files_properties(${APP_ICON_OUTPUT} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
  398. endif()
  399. find_library(APPKIT Appkit)
  400. find_library(AVFOUNDATION AVFoundation)
  401. find_library(APPLICATIONSERVICES ApplicationServices)
  402. mark_as_advanced(APPKIT AVFOUNDATION APPLICATIONSERVICES)
  403. target_link_libraries(obs PRIVATE ${APPKIT} ${AVFOUNDATION} ${APPLICATIONSERVICES})
  404. target_sources(obs PRIVATE platform-osx.mm)
  405. target_sources(obs PRIVATE forms/OBSPermissions.ui window-permissions.cpp window-permissions.hpp)
  406. target_sources(obs PRIVATE system-info-macos.mm)
  407. if(ENABLE_WHATSNEW)
  408. find_library(SECURITY Security)
  409. find_package(nlohmann_json REQUIRED)
  410. mark_as_advanced(SECURITY)
  411. target_link_libraries(obs PRIVATE ${SECURITY} OBS::blake2 nlohmann_json::nlohmann_json)
  412. target_sources(
  413. obs
  414. PRIVATE update/crypto-helpers.hpp
  415. update/crypto-helpers-mac.mm
  416. update/shared-update.cpp
  417. update/shared-update.hpp
  418. update/update-helpers.cpp
  419. update/update-helpers.hpp
  420. update/models/whatsnew.hpp)
  421. if(SPARKLE_APPCAST_URL AND SPARKLE_PUBLIC_KEY)
  422. find_library(SPARKLE Sparkle)
  423. mark_as_advanced(SPARKLE)
  424. target_sources(obs PRIVATE update/mac-update.cpp update/mac-update.hpp update/sparkle-updater.mm
  425. update/models/branches.hpp)
  426. target_compile_definitions(obs PRIVATE ENABLE_SPARKLE_UPDATER)
  427. target_link_libraries(obs PRIVATE ${SPARKLE})
  428. # Enable Automatic Reference Counting for Sparkle wrapper
  429. set_source_files_properties(update/sparkle-updater.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
  430. endif()
  431. endif()
  432. set_source_files_properties(platform-osx.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
  433. elseif(OS_POSIX)
  434. target_sources(obs PRIVATE platform-x11.cpp)
  435. target_link_libraries(obs PRIVATE Qt::GuiPrivate Qt::DBus)
  436. target_sources(obs PRIVATE system-info-posix.cpp)
  437. target_compile_definitions(obs PRIVATE OBS_INSTALL_PREFIX="${OBS_INSTALL_PREFIX}"
  438. "$<$<BOOL:${LINUX_PORTABLE}>:LINUX_PORTABLE>")
  439. if(TARGET obspython)
  440. find_package(Python REQUIRED COMPONENTS Interpreter Development)
  441. target_link_libraries(obs PRIVATE Python::Python)
  442. target_link_options(obs PRIVATE "LINKER:-no-as-needed")
  443. endif()
  444. if(NOT LINUX_PORTABLE)
  445. add_subdirectory(xdg-data)
  446. endif()
  447. if(OS_FREEBSD)
  448. target_link_libraries(obs PRIVATE procstat)
  449. target_compile_options(obs PRIVATE -Wno-unqualified-std-cast-call)
  450. endif()
  451. if(OS_LINUX)
  452. if(USE_XDG)
  453. target_compile_definitions(obs PRIVATE USE_XDG)
  454. endif()
  455. if(ENABLE_WHATSNEW)
  456. find_package(MbedTLS)
  457. find_package(nlohmann_json REQUIRED)
  458. if(NOT MBEDTLS_FOUND)
  459. obs_status(FATAL_ERROR "mbedTLS not found, but required for WhatsNew support on Linux")
  460. endif()
  461. target_sources(obs PRIVATE update/crypto-helpers.hpp update/crypto-helpers-mbedtls.cpp update/shared-update.cpp
  462. update/shared-update.hpp update/update-helpers.cpp update/update-helpers.hpp)
  463. target_link_libraries(obs PRIVATE Mbedtls::Mbedtls nlohmann_json::nlohmann_json OBS::blake2)
  464. endif()
  465. endif()
  466. endif()
  467. get_target_property(_SOURCES obs SOURCES)
  468. set(_UI ${_SOURCES})
  469. list(FILTER _UI INCLUDE REGEX ".*\\.ui?")
  470. source_group(
  471. TREE "${CMAKE_CURRENT_SOURCE_DIR}/forms"
  472. PREFIX "UI Files"
  473. FILES ${_UI})
  474. unset(_SOURCES)
  475. unset(_UI)
  476. get_property(OBS_MODULE_LIST GLOBAL PROPERTY OBS_MODULE_LIST)
  477. list(JOIN OBS_MODULE_LIST "|" SAFE_MODULES)
  478. target_compile_definitions(obs PRIVATE "SAFE_MODULES=\"${SAFE_MODULES}\"")
  479. define_graphic_modules(obs)
  480. setup_obs_app(obs)
  481. setup_target_resources(obs obs-studio)
  482. add_target_resource(obs ${CMAKE_CURRENT_SOURCE_DIR}/../AUTHORS obs-studio/authors)