DeprecationHelpers.cmake 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. function(upgrade_cmake_vars)
  2. if(DEFINED BROWSER_LEGACY)
  3. set(ENABLE_BROWSER_LEGACY
  4. "${BROWSER_LEGACY}"
  5. CACHE BOOL "" FORCE)
  6. endif()
  7. if(DEFINED BROWSER_PANEL_SUPPORT_ENABLED)
  8. set(ENABLE_BROWSER_PANELS
  9. "${BROWSER_PANEL_SUPPORT_ENABLED}"
  10. CACHE BOOL "" FORCE)
  11. endif()
  12. if(DEFINED BUILD_BROWSER)
  13. set(ENABLE_BROWSER
  14. "${BUILD_BROWSER}"
  15. CACHE BOOL "" FORCE)
  16. endif()
  17. if(DEFINED BUILD_CA_ENCODER)
  18. set(ENABLE_COREAUDIO_ENCODER
  19. "${BUILD_CA_ENCODER}"
  20. CACHE BOOL "" FORCE)
  21. endif()
  22. if(DEFINED BUILD_VST)
  23. set(ENABLE_VST
  24. "${BUILD_VST}"
  25. CACHE BOOL "" FORCE)
  26. endif()
  27. if(DEFINED CHECK_FOR_SERVICE_UPDATES)
  28. set(ENABLE_SERVICE_UPDATES
  29. "${CHECK_FOR_SERVICE_UPDATES}"
  30. CACHE BOOL "" FORCE)
  31. endif()
  32. if(DEFINED DEBUG_FFMPEG_MUX)
  33. set(ENABLE_FFMPEG_MUX_DEBUG
  34. "${DEBUG_FFMPEG_MUX}"
  35. CACHE BOOL "" FORCE)
  36. endif()
  37. if(DEFINED DISABLE_IVCAM)
  38. if(DISABLE_IVCAM)
  39. set(ENABLE_IVCAM
  40. OFF
  41. CACHE BOOL "" FORCE)
  42. else()
  43. set(ENABLE_IVCAM
  44. ON
  45. CACHE BOOL "" FORCE)
  46. endif()
  47. endif()
  48. if(DEFINED DISABLE_PLUGINS)
  49. if(DISABLE_PLUGINS)
  50. set(ENABLE_PLUGINS
  51. OFF
  52. CACHE BOOL "" FORCE)
  53. else()
  54. set(ENABLE_PLUGINS
  55. ON
  56. CACHE BOOL "" FORCE)
  57. endif()
  58. endif()
  59. if(DEFINED DISABLE_PYTHON)
  60. if(DISABLE_PYTHON)
  61. set(ENABLE_SCRIPTING_PYTHON
  62. OFF
  63. CACHE BOOL "" FORCE)
  64. else()
  65. set(ENABLE_SCRIPTING_PYTHON
  66. ON
  67. CACHE BOOL "" FORCE)
  68. endif()
  69. endif()
  70. if(DEFINED DISABLE_LUA)
  71. if(DISABLE_LUA)
  72. set(ENABLE_SCRIPTING_LUA
  73. OFF
  74. CACHE BOOL "" FORCE)
  75. else()
  76. set(ENABLE_SCRIPTING_LUA
  77. ON
  78. CACHE BOOL "" FORCE)
  79. endif()
  80. endif()
  81. if(DEFINED DISABLE_SPEEXDSP)
  82. if(DISABLE_SPEEXDSP)
  83. set(ENABLE_SPEEXDSP
  84. OFF
  85. CACHE BOOL "" FORCE)
  86. else()
  87. set(ENABLE_SPEEXDSP
  88. ON
  89. CACHE BOOL "" FORCE)
  90. endif()
  91. endif()
  92. if(DEFINED DISABLE_UPDATE_MODULE)
  93. if(DISABLE_UPDATE_MODULE)
  94. set(ENABLE_UPDATER
  95. OFF
  96. CACHE BOOL "" FORCE)
  97. else()
  98. set(ENABLE_UPDATER
  99. ON
  100. CACHE BOOL "" FORCE)
  101. endif()
  102. endif()
  103. if(DEFINED SHARED_TEXTURE_SUPPORT_ENABLED)
  104. set(ENABLE_BROWSER_SHARED_TEXTURE
  105. "${SHARED_TEXTURE_SUPPORT_ENABLED}"
  106. CACHE BOOL "" FORCE)
  107. endif()
  108. if(DEFINED STATIC_MBEDTLS)
  109. set(ENABLE_STATIC_MBEDTLS
  110. "${STATIC_MBEDTLS}"
  111. CACHE BOOL "" FORCE)
  112. endif()
  113. if(DEFINED UNIX_STRUCTURE AND UNIX_STRUCTURE)
  114. set(LINUX_PORTABLE
  115. OFF
  116. CACHE BOOL "" FORCE)
  117. endif()
  118. if(DEFINED USE_QT_LOOP)
  119. set(ENABLE_BROWSER_QT_LOOP
  120. "${USE_QT_LOOP}"
  121. CACHE BOOL "" FORCE)
  122. endif()
  123. if(DEFINED WITH_RTMPS)
  124. set(ENABLE_RTMPS
  125. "${WITH_RTMPS}"
  126. CACHE STRING "" FORCE)
  127. endif()
  128. endfunction()
  129. function(install_obs_plugin_with_data)
  130. obs_status(
  131. DEPRECATION
  132. "The install_obs_plugin_with_data command is deprecated and will be removed soon. Use 'setup_plugin_target' instead."
  133. )
  134. _install_obs_plugin_with_data(${ARGV})
  135. endfunction()
  136. function(install_obs_plugin)
  137. obs_status(
  138. DEPRECATION
  139. "The install_obs_plugin command is deprecated and will be removed soon. Use 'setup_plugin_target' instead."
  140. )
  141. _install_obs_plugin(${ARGV})
  142. endfunction()
  143. function(install_obs_datatarget)
  144. obs_status(
  145. DEPRECATION
  146. "The install_obs_datatarget function is deprecated and will be removed soon. Use 'setup_target_resources' instead."
  147. )
  148. _install_obs_datatarget(${ARGV})
  149. endfunction()
  150. function(__deprecated_var VAR ACCESS)
  151. if(ACCESS STREQUAL "READ_ACCESS")
  152. obs_status(DEPRECATION "The variable '${VAR}' is deprecated!")
  153. endif()
  154. endfunction()
  155. function(__deprecated_feature VAR ACCESS)
  156. if(ACCESS STREQUAL "UNKNOWN_READ_ACCESS")
  157. obs_status(
  158. DEPRECATION
  159. "The feature enabled by '${VAR}' is deprecated and will soon be removed from OBS."
  160. )
  161. endif()
  162. endfunction()
  163. set(_DEPRECATED_VARS
  164. zlibPath
  165. vulkanPath
  166. SwigPath
  167. PythonPath
  168. mbedtlsPath
  169. LuajitPath
  170. x264Path
  171. VlcPath
  172. VLCPath
  173. speexPath
  174. rnnoisePath
  175. LibfdkPath
  176. curlPath
  177. JanssonPath
  178. FFmpegPath
  179. DepsPath
  180. DepsPath32
  181. DepsPath64
  182. QTDIR32
  183. QTDIR64
  184. DISABLE_UI
  185. UI_ENABLED
  186. UNIX_STRUCTURE
  187. UPDATE_SPARKLE
  188. LIBOBS_PREFER_IMAGEMAGICK
  189. DEBUG_FFMPEG_MUX
  190. ENABLE_WINMF
  191. USE_QT_LOOP
  192. SHARED_TEXTURE_SUPPORT_ENABLED
  193. BROWSER_PANEL_SUPPORT_ENABLED
  194. BROWSER_LEGACY
  195. BUILD_BROWSER
  196. BUILD_CAPTIONS
  197. BUILD_CA_ENCODER
  198. BUILD_VST
  199. CHECK_FOR_SERVICE_UPDATES
  200. DISABLE_IVCAM
  201. DISABLE_LUA
  202. DISABLE_PLUGINS
  203. DISABLE_PYTHON
  204. DISABLE_SPEEXDSP
  205. DISABLE_UPDATE_MODULE
  206. SHARED_TEXTURE_SUPPORT_ENABLED
  207. STATIC_MBEDTLS
  208. UNIX_STRUCTURE
  209. USE_QT_LOOP
  210. WITH_RTMPS)
  211. foreach(_DEPRECATED_VAR IN LISTS _DEPRECATED_VARS)
  212. variable_watch(_DEPRECATED_VAR __deprecated_var)
  213. endforeach()
  214. variable_watch(FTL_FOUND __deprecated_feature)
  215. # Upgrade pre-existing build variables to their new variants as best as possible
  216. upgrade_cmake_vars()