DeprecationHelpers.cmake 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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. _install_obs_plugin(${ARGV})
  141. endfunction()
  142. function(install_obs_datatarget)
  143. obs_status(
  144. DEPRECATION
  145. "The install_obs_datatarget function is deprecated and will be removed soon. Use 'setup_target_resources' instead.")
  146. _install_obs_datatarget(${ARGV})
  147. endfunction()
  148. function(__deprecated_var VAR ACCESS)
  149. if(ACCESS STREQUAL "READ_ACCESS")
  150. obs_status(DEPRECATION "The variable '${VAR}' is deprecated!")
  151. endif()
  152. endfunction()
  153. function(__deprecated_feature VAR ACCESS)
  154. if(ACCESS STREQUAL "UNKNOWN_READ_ACCESS")
  155. obs_status(DEPRECATION "The feature enabled by '${VAR}' is deprecated and will soon be removed from OBS.")
  156. endif()
  157. endfunction()
  158. set(_DEPRECATED_VARS
  159. zlibPath
  160. vulkanPath
  161. SwigPath
  162. PythonPath
  163. mbedtlsPath
  164. LuajitPath
  165. x264Path
  166. VlcPath
  167. VLCPath
  168. speexPath
  169. rnnoisePath
  170. LibfdkPath
  171. curlPath
  172. JanssonPath
  173. FFmpegPath
  174. DepsPath
  175. DepsPath32
  176. DepsPath64
  177. QTDIR32
  178. QTDIR64
  179. DISABLE_UI
  180. UI_ENABLED
  181. UNIX_STRUCTURE
  182. UPDATE_SPARKLE
  183. LIBOBS_PREFER_IMAGEMAGICK
  184. DEBUG_FFMPEG_MUX
  185. ENABLE_WINMF
  186. USE_QT_LOOP
  187. SHARED_TEXTURE_SUPPORT_ENABLED
  188. BROWSER_PANEL_SUPPORT_ENABLED
  189. BROWSER_LEGACY
  190. BUILD_BROWSER
  191. BUILD_CAPTIONS
  192. BUILD_CA_ENCODER
  193. BUILD_VST
  194. CHECK_FOR_SERVICE_UPDATES
  195. DISABLE_IVCAM
  196. DISABLE_LUA
  197. DISABLE_PLUGINS
  198. DISABLE_PYTHON
  199. DISABLE_SPEEXDSP
  200. DISABLE_UPDATE_MODULE
  201. SHARED_TEXTURE_SUPPORT_ENABLED
  202. STATIC_MBEDTLS
  203. UNIX_STRUCTURE
  204. USE_QT_LOOP
  205. WITH_RTMPS)
  206. foreach(_DEPRECATED_VAR IN LISTS _DEPRECATED_VARS)
  207. variable_watch(_DEPRECATED_VAR __deprecated_var)
  208. endforeach()
  209. variable_watch(FTL_FOUND __deprecated_feature)
  210. # Upgrade pre-existing build variables to their new variants as best as possible
  211. upgrade_cmake_vars()