From aae3a6a4667e8c89f40a794e56c8620821f28276 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Fri, 25 Mar 2022 18:51:41 +0100 Subject: [PATCH] cmake: Fix diverging prefix padding for OBS status outputs Status output related to OBS configuration is prefixed with the string "OBS" and added padding for enabled and disabled features. This padding was not aligned between platforms. By moving the padding and prefix decoration into its own function, both elements are controlled in a single place. CMake scripts were changed to use this new function `obs_status` instead of using CMake's `message` function directly. --- UI/CMakeLists.txt | 2 +- cmake/Modules/CompilerConfig.cmake | 13 +++--- cmake/Modules/CopyMSVCBins.cmake | 53 ++++++++++++------------ cmake/Modules/DeprecationHelpers.cmake | 18 ++++---- cmake/Modules/FindCEF.cmake | 4 +- cmake/Modules/ObsHelpers.cmake | 17 +++++++- cmake/Modules/ObsHelpers_Windows.cmake | 4 +- cmake/Modules/ObsHelpers_macOS.cmake | 4 +- cmake/Modules/VersionConfig.cmake | 2 +- deps/CMakeLists.txt | 4 +- deps/obs-scripting/CMakeLists.txt | 18 ++++---- libobs/CMakeLists.txt | 2 +- plugins/CMakeLists.txt | 16 +++---- plugins/aja/CMakeLists.txt | 5 +-- plugins/coreaudio-encoder/CMakeLists.txt | 4 +- plugins/decklink/CMakeLists.txt | 2 +- plugins/linux-alsa/CMakeLists.txt | 2 +- plugins/linux-capture/CMakeLists.txt | 3 +- plugins/linux-jack/CMakeLists.txt | 2 +- plugins/linux-pipewire/CMakeLists.txt | 14 +++---- plugins/linux-pulseaudio/CMakeLists.txt | 2 +- plugins/linux-v4l2/CMakeLists.txt | 2 +- plugins/mac-virtualcam/CMakeLists.txt | 2 +- plugins/obs-filters/CMakeLists.txt | 10 ++--- plugins/obs-libfdk/CMakeLists.txt | 2 +- plugins/obs-outputs/CMakeLists.txt | 15 +++---- plugins/obs-qsv11/CMakeLists.txt | 2 +- plugins/oss-audio/CMakeLists.txt | 2 +- plugins/sndio/CMakeLists.txt | 2 +- plugins/text-freetype2/CMakeLists.txt | 2 +- plugins/vlc-video/CMakeLists.txt | 6 +-- plugins/win-dshow/CMakeLists.txt | 13 +++--- plugins/win-ivcam/CMakeLists.txt | 4 +- 33 files changed, 128 insertions(+), 125 deletions(-) diff --git a/UI/CMakeLists.txt b/UI/CMakeLists.txt index 9737437da..9f17a6e27 100644 --- a/UI/CMakeLists.txt +++ b/UI/CMakeLists.txt @@ -2,7 +2,7 @@ add_subdirectory(obs-frontend-api) option(ENABLE_UI "Enable building with UI (requires Qt)" ON) if(NOT ENABLE_UI) - message(STATUS "OBS: DISABLED OBS UI") + obs_status(DISABLED "OBS UI") return() endif() diff --git a/cmake/Modules/CompilerConfig.cmake b/cmake/Modules/CompilerConfig.cmake index 5c99daca8..f923efb03 100644 --- a/cmake/Modules/CompilerConfig.cmake +++ b/cmake/Modules/CompilerConfig.cmake @@ -16,10 +16,8 @@ if(OS_WINDOWS AND MSVC) endif() # Check for Win SDK version 10.0.20348 or above - message( - INFO - " + OBS-Studio - Windows API version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}" - ) + obs_status( + STATUS "Windows API version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}") string(REPLACE "." ";" WINAPI_VER "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}") @@ -41,11 +39,10 @@ if(OS_WINDOWS AND MSVC) endif() if(NOT WINAPI_COMPATIBLE) - message( + obs_status( FATAL_ERROR - "OBS: OBS requires Windows 10 SDK version 10.0.20348.0 and above to compile.\n" - " Please download the most recent Windows 10 SDK in order to compile." - ) + "OBS requires Windows 10 SDK version 10.0.20348.0 and above to compile.\n" + "Please download the most recent Windows 10 SDK in order to compile.") endif() add_compile_options( diff --git a/cmake/Modules/CopyMSVCBins.cmake b/cmake/Modules/CopyMSVCBins.cmake index 6ff2638ba..de253d305 100644 --- a/cmake/Modules/CopyMSVCBins.cmake +++ b/cmake/Modules/CopyMSVCBins.cmake @@ -280,31 +280,32 @@ foreach( endif() endforeach() -message(STATUS "FFmpeg files: ${FFMPEG_BIN_FILES}") -message(STATUS "x264 files: ${X264_BIN_FILES}") -message(STATUS "Libfdk files: ${LIBFDK_BIN_FILES}") -message(STATUS "Freetype files: ${FREETYPE_BIN_FILES}") -message(STATUS "rnnoise files: ${RNNOISE_BIN_FILES}") -message(STATUS "curl files: ${CURL_BIN_FILES}") -message(STATUS "lua files: ${LUA_BIN_FILES}") -message(STATUS "ssl files: ${SSL_BIN_FILES}") -message(STATUS "zlib files: ${ZLIB_BIN_FILES}") -message(STATUS "QT Debug files: ${QT_DEBUG_BIN_FILES}") -message(STATUS "QT Debug Platform files: ${QT_DEBUG_PLAT_BIN_FILES}") -message(STATUS "QT Debug Styles files: ${QT_DEBUG_STYLES_BIN_FILES}") -message(STATUS "QT Debug Iconengine files: ${QT_DEBUG_ICONENGINE_BIN_FILES}") -message(STATUS "QT Debug Imageformat files: ${QT_DEBUG_IMAGEFORMATS_BIN_FILES}") -message(STATUS "QT Release files: ${QT_BIN_FILES}") -message(STATUS "QT Release Platform files: ${QT_PLAT_BIN_FILES}") -message(STATUS "QT Release Styles files: ${QT_STYLES_BIN_FILES}") -message(STATUS "QT Release Iconengine files: ${QT_ICONENGINE_BIN_FILES}") -message(STATUS "QT Release Imageformat files: ${QT_IMAGEFORMATS_BIN_FILES}") -message(STATUS "QT ICU files: ${QT_ICU_BIN_FILES}") +obs_status(STATUS "FFmpeg files: ${FFMPEG_BIN_FILES}") +obs_status(STATUS "x264 files: ${X264_BIN_FILES}") +obs_status(STATUS "Libfdk files: ${LIBFDK_BIN_FILES}") +obs_status(STATUS "Freetype files: ${FREETYPE_BIN_FILES}") +obs_status(STATUS "rnnoise files: ${RNNOISE_BIN_FILES}") +obs_status(STATUS "curl files: ${CURL_BIN_FILES}") +obs_status(STATUS "lua files: ${LUA_BIN_FILES}") +obs_status(STATUS "ssl files: ${SSL_BIN_FILES}") +obs_status(STATUS "zlib files: ${ZLIB_BIN_FILES}") +obs_status(STATUS "QT Debug files: ${QT_DEBUG_BIN_FILES}") +obs_status(STATUS "QT Debug Platform files: ${QT_DEBUG_PLAT_BIN_FILES}") +obs_status(STATUS "QT Debug Styles files: ${QT_DEBUG_STYLES_BIN_FILES}") +obs_status(STATUS "QT Debug Iconengine files: ${QT_DEBUG_ICONENGINE_BIN_FILES}") +obs_status(STATUS + "QT Debug Imageformat files: ${QT_DEBUG_IMAGEFORMATS_BIN_FILES}") +obs_status(STATUS "QT Release files: ${QT_BIN_FILES}") +obs_status(STATUS "QT Release Platform files: ${QT_PLAT_BIN_FILES}") +obs_status(STATUS "QT Release Styles files: ${QT_STYLES_BIN_FILES}") +obs_status(STATUS "QT Release Iconengine files: ${QT_ICONENGINE_BIN_FILES}") +obs_status(STATUS "QT Release Imageformat files: ${QT_IMAGEFORMATS_BIN_FILES}") +obs_status(STATUS "QT ICU files: ${QT_ICU_BIN_FILES}") foreach(BinFile ${ALL_BASE_BIN_FILES}) - message( + obs_status( STATUS - "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}" + "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}" ) file( COPY "${BinFile}" @@ -313,9 +314,9 @@ foreach(BinFile ${ALL_BASE_BIN_FILES}) endforeach() foreach(BinFile ${ALL_REL_BIN_FILES}) - message( + obs_status( STATUS - "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r" + "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r" ) file( COPY "${BinFile}" @@ -324,9 +325,9 @@ foreach(BinFile ${ALL_REL_BIN_FILES}) endforeach() foreach(BinFile ${ALL_DBG_BIN_FILES}) - message( + obs_status( STATUS - "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d" + "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d" ) file( COPY "${BinFile}" diff --git a/cmake/Modules/DeprecationHelpers.cmake b/cmake/Modules/DeprecationHelpers.cmake index 55f554046..f17503b4b 100644 --- a/cmake/Modules/DeprecationHelpers.cmake +++ b/cmake/Modules/DeprecationHelpers.cmake @@ -145,40 +145,40 @@ function(upgrade_cmake_vars) endfunction() function(install_obs_plugin_with_data) - message( + obs_status( DEPRECATION - "OBS: The install_obs_plugin_with_data command is deprecated and will be removed soon. Use 'setup_plugin_target' instead." + "The install_obs_plugin_with_data command is deprecated and will be removed soon. Use 'setup_plugin_target' instead." ) _install_obs_plugin_with_data(${ARGV}) endfunction() function(install_obs_plugin) - message( + obs_status( DEPRECATION - "OBS: The install_obs_plugin command is deprecated and will be removed soon. Use 'setup_plugin_target' instead." + "The install_obs_plugin command is deprecated and will be removed soon. Use 'setup_plugin_target' instead." ) _install_obs_plugin(${ARGV}) endfunction() function(install_obs_datatarget) - message( + obs_status( DEPRECATION - "OBS: The install_obs_datatarget function is deprecated and will be removed soon. Use 'setup_target_resources' instead." + "The install_obs_datatarget function is deprecated and will be removed soon. Use 'setup_target_resources' instead." ) _install_obs_datatarget(${ARGV}) endfunction() function(__deprecated_var VAR ACCESS) if(ACCESS STREQUAL "READ_ACCESS") - message(DEPRECATION "OBS: The variable '${VAR}' is deprecated!") + obs_status(DEPRECATION "The variable '${VAR}' is deprecated!") endif() endfunction() function(__deprecated_feature VAR ACCESS) if(ACCESS STREQUAL "UNKNOWN_READ_ACCESS") - message( + obs_status( DEPRECATION - "OBS: The feature enabled by '${VAR}' is deprecated and will soon be removed from OBS." + "The feature enabled by '${VAR}' is deprecated and will soon be removed from OBS." ) endif() endfunction() diff --git a/cmake/Modules/FindCEF.cmake b/cmake/Modules/FindCEF.cmake index 00d020328..9b961a92b 100644 --- a/cmake/Modules/FindCEF.cmake +++ b/cmake/Modules/FindCEF.cmake @@ -70,7 +70,7 @@ mark_as_advanced(CEFWRAPPER_LIBRARY CEFWRAPPER_LIBRARY_DEBUG) if(NOT CEF_LIBRARY) message( WARNING - " Could NOT find Chromium Embedded Framework library (missing: CEF_LIBRARY)" + "Could NOT find Chromium Embedded Framework library (missing: CEF_LIBRARY)" ) set(CEF_FOUND FALSE) return() @@ -79,7 +79,7 @@ endif() if(NOT CEFWRAPPER_LIBRARY) message( WARNING - " Could NOT find Chromium Embedded Framework wrapper library (missing: CEFWRAPPER_LIBRARY)" + "Could NOT find Chromium Embedded Framework wrapper library (missing: CEFWRAPPER_LIBRARY)" ) set(CEF_FOUND FALSE) return() diff --git a/cmake/Modules/ObsHelpers.cmake b/cmake/Modules/ObsHelpers.cmake index 57e4246bd..d5d156604 100644 --- a/cmake/Modules/ObsHelpers.cmake +++ b/cmake/Modules/ObsHelpers.cmake @@ -85,7 +85,7 @@ function(setup_plugin_target target) COMMENT "Installing ${target} to OBS rundir" VERBATIM) - message(STATUS "OBS: ENABLED ${target}") + obs_status(ENABLED "${target}") endfunction() # Helper function to set up OBS scripting plugin targets @@ -127,7 +127,7 @@ function(setup_script_plugin_target target) COMMENT "Installing ${target} to OBS rundir" VERBATIM) - message(STATUS "OBS: ENABLED ${target}") + obs_status(ENABLED "${target}") endfunction() # Helper function to set up target resources (e.g. L10N files) @@ -385,6 +385,19 @@ macro(set_option option value) CACHE INTERNAL "") endmacro() +function(obs_status status text) + set(_OBS_STATUS_DISABLED "OBS: DISABLED ") + set(_OBS_STATUS_ENABLED "OBS: ENABLED ") + set(_OBS_STATUS "OBS: ") + if(status STREQUAL "DISABLED") + message(STATUS "${_OBS_STATUS_DISABLED}${text}") + elseif(status STREQUAL "ENABLED") + message(STATUS "${_OBS_STATUS_ENABLED}${text}") + else() + message(${status} "${_OBS_STATUS}${text}") + endif() +endfunction() + if(OS_WINDOWS) include(ObsHelpers_Windows) elseif(OS_MACOS) diff --git a/cmake/Modules/ObsHelpers_Windows.cmake b/cmake/Modules/ObsHelpers_Windows.cmake index 2e738ebfe..292a37749 100644 --- a/cmake/Modules/ObsHelpers_Windows.cmake +++ b/cmake/Modules/ObsHelpers_Windows.cmake @@ -383,9 +383,9 @@ endfunction() function(generate_multiarch_installer) if(NOT DEFINED ENV{OBS_InstallerTempDir} AND NOT DEFINED ENV{obsInstallerTempDir}) - message( + obs_status( FATAL_ERROR - "Function generate_multiarch_installer requires environment variable 'OBS_InstallerTempDir' to be set" + "Function generate_multiarch_installer requires environment variable 'OBS_InstallerTempDir' to be set" ) endif() diff --git a/cmake/Modules/ObsHelpers_macOS.cmake b/cmake/Modules/ObsHelpers_macOS.cmake index 2e162317a..20734bd49 100644 --- a/cmake/Modules/ObsHelpers_macOS.cmake +++ b/cmake/Modules/ObsHelpers_macOS.cmake @@ -95,7 +95,7 @@ function(setup_plugin_target target) "${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/entitlements.plist") set_property(GLOBAL APPEND PROPERTY OBS_MODULE_LIST "${target}") - message(STATUS "OBS: ENABLED ${target}") + obs_status(ENABLED "${target}") install_bundle_resources(${target}) endfunction() @@ -112,7 +112,7 @@ function(setup_script_plugin_target target) "${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/entitlements.plist") set_property(GLOBAL APPEND PROPERTY OBS_SCRIPTING_MODULE_LIST "${target}") - message(STATUS "OBS: ENABLED ${target}") + obs_status(ENABLED "${target}") endfunction() # Helper function to set up target resources (e.g. L10N files) diff --git a/cmake/Modules/VersionConfig.cmake b/cmake/Modules/VersionConfig.cmake index 78a9146ca..387a042c2 100644 --- a/cmake/Modules/VersionConfig.cmake +++ b/cmake/Modules/VersionConfig.cmake @@ -99,5 +99,5 @@ file(WRITE ${BUILD_NUMBER_CACHE} "${OBS_BUILD_NUMBER}") message( STATUS - "OBS: Application Version: ${OBS_VERSION} - Build Number: ${OBS_BUILD_NUMBER}" + "OBS: Application Version: ${OBS_VERSION} - Build Number: ${OBS_BUILD_NUMBER}" ) diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index cfc8c1c01..6eb263ce5 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -18,10 +18,10 @@ add_subdirectory(libcaption) # Use bundled jansson version as fallback find_package(Jansson 2.5 QUIET) if(NOT TARGET Jansson::Jansson) - message(STATUS "OBS: Jansson >=2.5 not found, building bundled version") + obs_status(STATUS "Jansson >=2.5 not found, building bundled version.") add_subdirectory(jansson) add_library(Jansson::Jansson ALIAS jansson) else() - message(STATUS "OBS: OBS-Studio - Using system Jansson library") + obs_status(STATUS "Using system Jansson library.") endif() diff --git a/deps/obs-scripting/CMakeLists.txt b/deps/obs-scripting/CMakeLists.txt index 5cdbbee0d..8d4102b34 100644 --- a/deps/obs-scripting/CMakeLists.txt +++ b/deps/obs-scripting/CMakeLists.txt @@ -2,7 +2,7 @@ option(ENABLE_SCRIPTING_LUA "Enable Lua scripting support" ON) option(ENABLE_SCRIPTING_PYTHON "Enable Python scripting support" ON) if(NOT ENABLE_SCRIPTING) - message(STATUS "OBS: DISABLED obs-scripting") + obs_status(DISABLED "obs-scripting") return() endif() @@ -13,13 +13,13 @@ if(ENABLE_SCRIPTING_LUA) find_package(Luajit) if(NOT TARGET Luajit::Luajit) - message(FATAL_ERROR "OBS: - Luajit not found") + obs_status(FATAL_ERROR "obs-scripting -> Luajit not found.") return() else() - message(STATUS "OBS: - Luajit found") + obs_status(STATUS "obs-scripting -> Luajit found.") endif() else() - message(STATUS "OBS: DISABLED Luajit support") + obs_status(DISABLED "Luajit support") endif() if(ENABLE_SCRIPTING_PYTHON) @@ -31,19 +31,17 @@ if(ENABLE_SCRIPTING_PYTHON) endif() if(NOT TARGET Python::Python) - message(FATAL_ERROR "OBS: - Python not found") + obs_status(FATAL_ERROR "obs-scripting -> Python not found.") return() else() - message(STATUS "OBS: - Python ${Python_VERSION} found") + obs_status(STATUS "obs-scripting -> Python ${Python_VERSION} found.") endif() else() - message(STATUS "OBS: DISABLED Python support") + obs_status(DISABLED "Python support") endif() if(NOT TARGET Luajit::Luajit AND NOT TARGET Python::Python) - message( - WARNING - "OBS: DISABLED obs-scripting - no supported scripting libraries found") + obs_status(WARNING "obs-scripting -> No supported scripting libraries found.") return() endif() diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt index 57d8e9c15..77043f8b7 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt @@ -385,7 +385,7 @@ elseif(OS_POSIX) if(ENABLE_PULSEAUDIO) find_package(PulseAudio REQUIRED) - message(STATUS "OBS: PulseAudio found - audio monitoring enabled") + obs_status(STATUS "-> PulseAudio found - audio monitoring enabled") target_sources( libobs PRIVATE audio-monitoring/pulse/pulseaudio-output.c diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 242b421d5..b9f2924df 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -1,6 +1,6 @@ option(ENABLE_PLUGINS "Enable building OBS plugins" ON) if(NOT ENABLE_PLUGINS) - message(STATUS "OBS: building with plugins disabled") + obs_status(STATUS "Building with plugins disabled.") return() endif() @@ -8,7 +8,7 @@ function(check_obs_browser) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/obs-browser/CMakeLists.txt) add_subdirectory(obs-browser) else() - message(FATAL_ERROR "OBS: obs-browser submodule not available") + obs_status(FATAL_ERROR "obs-browser submodule not available.") endif() endfunction() @@ -16,7 +16,7 @@ function(check_obs_vst) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/obs-vst/CMakeLists.txt) add_subdirectory(obs-vst) else() - message(FATAL_ERROR "OBS: obs-vst submodule not available") + obs_status(FATAL_ERROR "obs-vst submodule not available.") endif() endfunction() @@ -36,7 +36,7 @@ if(OS_WINDOWS) if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/enc-amf/CMakeLists.txt") add_subdirectory(enc-amf) else() - message(WARNING "OBS: enc-amf plugin not found") + obs_status(WARNING "enc-amf plugin not found.") endif() if(MSVC) add_subdirectory(win-ivcam) @@ -80,14 +80,14 @@ elseif(OS_FREEBSD) add_subdirectory(oss-audio) add_subdirectory(sndio) - message(STATUS "OBS: obs-browser plugin not available") - message(STATUS "OBS: obs-vst plugin not available") + obs_status(STATUS "obs-browser plugin not available.") + obs_status(STATUS "obs-vst plugin not available.") elseif(OS_OPENBSD) add_subdirectory(linux-capture) add_subdirectory(sndio) - message(STATUS "OBS: obs-browser plugin not available") - message(STATUS "OBS: obs-vst plugin not available") + obs_status(STATUS "obs-browser plugin not available.") + obs_status(STATUS "obs-vst plugin not available.") endif() add_subdirectory(image-source) diff --git a/plugins/aja/CMakeLists.txt b/plugins/aja/CMakeLists.txt index af0ee7685..b571e3a0a 100644 --- a/plugins/aja/CMakeLists.txt +++ b/plugins/aja/CMakeLists.txt @@ -2,13 +2,12 @@ project(aja) option(ENABLE_AJA "Build OBS with aja support" ON) if(NOT ENABLE_AJA) - message(STATUS "OBS: DISABLED aja") + obs_status(DISABLED "aja") return() endif() if(NOT OS_MACOS AND NOT CMAKE_SIZEOF_VOID_P EQUAL 8) - message( - STATUS "OBS: aja support not enabled (32-bit not supported)") + obs_status(STATUS "aja support not enabled (32-bit not supported).") set(ENABLE_AJA OFF CACHE BOOL "Build OBS with aja support" FORCE) diff --git a/plugins/coreaudio-encoder/CMakeLists.txt b/plugins/coreaudio-encoder/CMakeLists.txt index 22c9aa3b6..4fd4c7688 100644 --- a/plugins/coreaudio-encoder/CMakeLists.txt +++ b/plugins/coreaudio-encoder/CMakeLists.txt @@ -1,10 +1,10 @@ project(coreaudio-encoder) -if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") +if(OS_WINDOWS) option(ENABLE_COREAUDIO_ENCODER "Enable building with CoreAudio encoder (Windows)" ON) if(NOT ENABLE_COREAUDIO_ENCODER) - message(STATUS "OBS: DISABLED coreaudio-encoder") + obs_status(DISABLED "coreaudio-encoder") return() endif() endif() diff --git a/plugins/decklink/CMakeLists.txt b/plugins/decklink/CMakeLists.txt index 30980c32e..d21f933b4 100644 --- a/plugins/decklink/CMakeLists.txt +++ b/plugins/decklink/CMakeLists.txt @@ -2,7 +2,7 @@ project(decklink) option(ENABLE_DECKLINK "Build OBS with Decklink support" ON) if(NOT ENABLE_DECKLINK) - message(STATUS "OBS: DISABLED decklink support") + obs_status(DISABLED "decklink") return() endif() diff --git a/plugins/linux-alsa/CMakeLists.txt b/plugins/linux-alsa/CMakeLists.txt index d0d763a09..a3ea221fb 100644 --- a/plugins/linux-alsa/CMakeLists.txt +++ b/plugins/linux-alsa/CMakeLists.txt @@ -2,7 +2,7 @@ project(linux-alsa) option(ENABLE_ALSA "Build OBS with ALSA support" ON) if(NOT ENABLE_ALSA) - message(STATUS "OBS: DISABLED alsa") + obs_status(DISABLED "linux-alsa") return() endif() diff --git a/plugins/linux-capture/CMakeLists.txt b/plugins/linux-capture/CMakeLists.txt index 5e93f994a..757fea3a0 100644 --- a/plugins/linux-capture/CMakeLists.txt +++ b/plugins/linux-capture/CMakeLists.txt @@ -2,8 +2,7 @@ project(linux-capture) find_package(X11 REQUIRED) if(NOT TARGET X11::Xcomposite) - message( - FATAL_ERROR "OBS: DISABLED linux-capture - Xcomposite library not found") + obs_status(FATAL_ERROR "linux-capture - Xcomposite library not found.") endif() find_package(XCB COMPONENTS XCB XFIXES RANDR SHM XINERAMA) diff --git a/plugins/linux-jack/CMakeLists.txt b/plugins/linux-jack/CMakeLists.txt index e2c79ebc0..25fe06dce 100644 --- a/plugins/linux-jack/CMakeLists.txt +++ b/plugins/linux-jack/CMakeLists.txt @@ -2,7 +2,7 @@ project(linux-jack) option(ENABLE_JACK "Build OBS with JACK support" OFF) if(NOT ENABLE_JACK) - message(STATUS "OBS: DISABLED linux-jack") + obs_status(DISABLED "linux-jack") return() endif() diff --git a/plugins/linux-pipewire/CMakeLists.txt b/plugins/linux-pipewire/CMakeLists.txt index 73f0ca1b5..da495b83f 100644 --- a/plugins/linux-pipewire/CMakeLists.txt +++ b/plugins/linux-pipewire/CMakeLists.txt @@ -2,7 +2,7 @@ project(linux-pipewire) option(ENABLE_PIPEWIRE "Enable PipeWire support" ON) if(NOT ENABLE_PIPEWIRE) - message(STATUS "PipeWire support disabled, linux-pipewire plugin disabled") + obs_status(DISABLED "linux-pipewire") return() endif() @@ -11,19 +11,19 @@ find_package(Gio QUIET) find_package(Libdrm QUIET) # we require libdrm/drm_fourcc.h to build if(NOT TARGET PipeWire::PipeWire) - message( + obs_status( FATAL_ERROR - "OBS: - PipeWire library not found! Please install PipeWire or set ENABLE_PIPEWIRE=OFF" + "PipeWire library not found! Please install PipeWire or set ENABLE_PIPEWIRE=OFF." ) elseif(NOT TARGET GIO::GIO) - message( + obs_status( FATAL_ERROR - "OBS: - Gio library not found! Please install GLib2 (or Gio) or set ENABLE_PIPEWIRE=OFF" + "Gio library not found! Please install GLib2 (or Gio) or set ENABLE_PIPEWIRE=OFF." ) elseif(NOT TARGET Libdrm::Libdrm) - message( + obs_status( FATAL_ERROR - "OBS: - libdrm headers not found! Please install libdrm or set ENABLE_PIPEWIRE=OFF" + "libdrm headers not found! Please install libdrm or set ENABLE_PIPEWIRE=OFF." ) endif() diff --git a/plugins/linux-pulseaudio/CMakeLists.txt b/plugins/linux-pulseaudio/CMakeLists.txt index 6913ee87a..b0c970de7 100644 --- a/plugins/linux-pulseaudio/CMakeLists.txt +++ b/plugins/linux-pulseaudio/CMakeLists.txt @@ -3,7 +3,7 @@ project(linux-pulseaudio) option(ENABLE_PULSEAUDIO "Enable PulseAudio support" ON) if(NOT ENABLE_PULSEAUDIO) - message(STATUS "OBS: DISABLED linux-pulseaudio") + obs_status(DISABLED "linux-pulseaudio") return() endif() diff --git a/plugins/linux-v4l2/CMakeLists.txt b/plugins/linux-v4l2/CMakeLists.txt index c427b738d..99c2ac806 100644 --- a/plugins/linux-v4l2/CMakeLists.txt +++ b/plugins/linux-v4l2/CMakeLists.txt @@ -2,7 +2,7 @@ project(linux-v4l2) option(ENABLE_V4L2 "Build OBS with v4l2 support" ON) if(NOT ENABLE_V4L2) - message(STATUS "OBS: DISABLED linux-v4l2") + obs_status(DISABLED "linux-v4l2") return() endif() diff --git a/plugins/mac-virtualcam/CMakeLists.txt b/plugins/mac-virtualcam/CMakeLists.txt index 8bbe6ccc4..2ac3d6ddc 100644 --- a/plugins/mac-virtualcam/CMakeLists.txt +++ b/plugins/mac-virtualcam/CMakeLists.txt @@ -1,7 +1,7 @@ option(ENABLE_VIRTUALCAM "Build OBS Virtualcam" ON) if(NOT ENABLE_VIRTUALCAM) - message(STATUS "OBS: DISABLED mac-virtualcam") + obs_status(DISABLED "mac-virtualcam") return() endif() diff --git a/plugins/obs-filters/CMakeLists.txt b/plugins/obs-filters/CMakeLists.txt index c8c4ad0f6..cd65007fe 100644 --- a/plugins/obs-filters/CMakeLists.txt +++ b/plugins/obs-filters/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(OBS::filters ALIAS obs-filters) set(HAS_NOISEREDUCTION OFF) if(NOT ENABLE_SPEEXDSP) - message(STATUS "OBS: DISABLED SpeexDSP") + obs_status(DISABLED "SpeexDSP") else() find_package(Libspeexdsp REQUIRED) @@ -33,12 +33,12 @@ else() endif() if(NOT ENABLE_RNNOISE) - message(STATUS "OBS: DISABLED RNNoise") + obs_status(DISABLED "SpeexDSP") else() find_package(Librnnoise QUIET) if(NOT TARGET Librnnoise::Librnnoise) - message(STATUS "OBS: - using bundled RNNoise library") + obs_status(STATUS "obs-filters -> using bundled RNNoise library") add_library(obs-rnnoise INTERFACE) add_library(Librnnoise::Librnnoise ALIAS obs-rnnoise) @@ -85,10 +85,10 @@ else() endif() if(NOT ENABLE_NVAFX) - message(STATUS "OBS: DISABLED NVidia Audio FX support") + obs_status(DISABLED "NVidia Audio FX support") set(LIBNVAFX_FOUND OFF) else() - message(STATUS "OBS: ENABLED NVidia Audio FX support") + obs_status(ENABLED "NVidia Audio FX support") target_compile_definitions(obs-filters PRIVATE LIBNVAFX_ENABLED) diff --git a/plugins/obs-libfdk/CMakeLists.txt b/plugins/obs-libfdk/CMakeLists.txt index c5d7ab34e..efdb6908f 100644 --- a/plugins/obs-libfdk/CMakeLists.txt +++ b/plugins/obs-libfdk/CMakeLists.txt @@ -3,7 +3,7 @@ project(obs-libfdk) option(ENABLE_LIBFDK "Enable FDK AAC support" OFF) if(NOT ENABLE_LIBFDK) - message(STATUS "OBS: DISABLED obs-libfdk") + obs_status(DISABLED "obs-libfdk") return() endif() diff --git a/plugins/obs-outputs/CMakeLists.txt b/plugins/obs-outputs/CMakeLists.txt index a9d90ec1d..124df673f 100644 --- a/plugins/obs-outputs/CMakeLists.txt +++ b/plugins/obs-outputs/CMakeLists.txt @@ -52,16 +52,13 @@ if(ENABLE_RTMPS STREQUAL "AUTO" OR ENABLE_RTMPS STREQUAL "ON") find_package(ZLIB) if(NOT MBEDTLS_FOUND OR NOT ZLIB_FOUND) if(ENABLE_RTMPS STREQUAL "ON") - message( - FATAL_ERROR - "OBS: - mbedTLS or zlib not found, but required for RTMPS support." - ) + obs_status(FATAL_ERROR + "mbedTLS or zlib not found, but required for RTMPS support.") return() else() - message( + obs_status( WARNING - "OBS: - mbedTLS or zlib was not found, RTMPS will be auto-disabled" - ) + "mbedTLS or zlib was not found, RTMPS will be automatically disabled.") target_compile_definitions(obs-outputs PRIVATE NO_CRYPTO) endif() else() @@ -115,7 +112,7 @@ endif() if(FTL_FOUND) find_package(CURL REQUIRED) - message(STATUS "OBS: ENABLED ftl outputs (system ftl-sdk)") + obs_status(ENABLED "ftl outputs (system ftl-sdk)") target_sources(obs-outputs PRIVATE ftl-stream.c) @@ -129,7 +126,7 @@ if(FTL_FOUND) elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ftl-sdk/CMakeLists.txt") find_package(CURL REQUIRED) - message(STATUS "OBS: ENABLED ftl ouputs (bundled ftl-sdk)") + obs_status(ENABLED "ftl ouputs (bundled ftl-sdk)") target_compile_definitions(obs-outputs PRIVATE FTL_STATIC_COMPILE) diff --git a/plugins/obs-qsv11/CMakeLists.txt b/plugins/obs-qsv11/CMakeLists.txt index 1ef2fd93f..ee05bdbd8 100644 --- a/plugins/obs-qsv11/CMakeLists.txt +++ b/plugins/obs-qsv11/CMakeLists.txt @@ -1,7 +1,7 @@ option(ENABLE_QSV11 "Build Intel QSV11 Hardware Encoder." TRUE) if(NOT ENABLE_QSV11) - message(STATUS "OBS: DISABLED obs-qsv11") + obs_status(DISABLED "obs-qsv11") return() endif() diff --git a/plugins/oss-audio/CMakeLists.txt b/plugins/oss-audio/CMakeLists.txt index 4abad7567..b538cf4db 100644 --- a/plugins/oss-audio/CMakeLists.txt +++ b/plugins/oss-audio/CMakeLists.txt @@ -3,7 +3,7 @@ project(oss-audio) option(ENABLE_OSS "Enable building with OSS audio support" ON) if(NOT ENABLE_OSS) - message(STATUS "OBS: DISABLED oss-audio") + obs_status(DISABLED "oss-audio") return() endif() diff --git a/plugins/sndio/CMakeLists.txt b/plugins/sndio/CMakeLists.txt index 843299c21..850f685e3 100644 --- a/plugins/sndio/CMakeLists.txt +++ b/plugins/sndio/CMakeLists.txt @@ -2,7 +2,7 @@ project(sndio) option(ENABLE_SNDIO "Build OBS with sndio support" OFF) if(NOT ENABLE_SNDIO) - message(STATUS "OBS: DISABLED sndio") + obs_status(DISABLED "sndio") return() endif() diff --git a/plugins/text-freetype2/CMakeLists.txt b/plugins/text-freetype2/CMakeLists.txt index fce96cffe..4dda86fb4 100644 --- a/plugins/text-freetype2/CMakeLists.txt +++ b/plugins/text-freetype2/CMakeLists.txt @@ -3,7 +3,7 @@ project(text-freetype2) option(ENABLE_FREETYPE "Enable FreeType text plugin" ON) if(NOT ENABLE_FREETYPE) - message(STATUS "OBS: DISABLED text-freetype2") + obs_status(DISABLED "text-freetype2") return() endif() diff --git a/plugins/vlc-video/CMakeLists.txt b/plugins/vlc-video/CMakeLists.txt index f93fa2cdd..f1f66c98a 100644 --- a/plugins/vlc-video/CMakeLists.txt +++ b/plugins/vlc-video/CMakeLists.txt @@ -2,10 +2,10 @@ project(vlc-video) option(ENABLE_VLC "Build OBS with VLC plugin support" ${OS_LINUX}) if(NOT ENABLE_VLC) - message(STATUS "OBS: DISABLED vlc-video") - message( + obs_status(DISABLED "vlc-video") + obs_status( WARNING - "VLC plugin supported is not enabled by default - please switch ENABLE_VLC to ON to enable this functionality." + "VLC plugin supported is not enabled by default - please switch ENABLE_VLC to ON to enable this functionality." ) return() endif() diff --git a/plugins/win-dshow/CMakeLists.txt b/plugins/win-dshow/CMakeLists.txt index 6d3c095cb..cd38e6013 100644 --- a/plugins/win-dshow/CMakeLists.txt +++ b/plugins/win-dshow/CMakeLists.txt @@ -1,7 +1,7 @@ if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture/dshowcapture.hpp") - message( + obs_status( FATAL_ERROR - "OBS: libdshowcapture submodule not found! Please fetch submodules. win-dshow plugin disabled." + "libdshowcapture submodule not found! Please fetch submodules. win-dshow plugin disabled." ) return() endif() @@ -9,7 +9,7 @@ endif() option(ENABLE_VIRTUALCAM "Enable building with Virtual Camera (Windows)" ON) if(NOT ENABLE_VIRTUALCAM) - message(STATUS "OBS: DISABLED Windows Virtual Camera") + obs_status(DISABLED "Windows Virtual Camera") endif() if(ENABLE_VIRTUALCAM AND NOT VIRTUALCAM_GUID) @@ -78,9 +78,9 @@ target_compile_definitions( set(VIRTUALCAM_AVAILABLE OFF) if(VIRTUALCAM_GUID STREQUAL "") - message( + obs_status( WARNING - "OBS: DISABLED Windows Virtual Camera - GUID not set - specify as 'VIRTUALCAM_GUID' to enable." + "Windows Virtual Camera - GUID not set - specify as 'VIRTUALCAM_GUID' to enable." ) else() set(INVALID_GUID ON) @@ -126,8 +126,7 @@ else() endif() if(INVALID_GUID) - message( - WARNING "OBS: DISABLED Windows Virtual Camera - invalid GUID supplied") + obs_status(WARNING "Windows Virtual Camera - invalid GUID supplied") endif() target_link_libraries( diff --git a/plugins/win-ivcam/CMakeLists.txt b/plugins/win-ivcam/CMakeLists.txt index b3713a74c..dc3853f5b 100644 --- a/plugins/win-ivcam/CMakeLists.txt +++ b/plugins/win-ivcam/CMakeLists.txt @@ -1,7 +1,7 @@ option(ENABLE_IVCAM "Enable building with Realsense camera support" OFF) if(NOT ENABLE_IVCAM) - message(STATUS "OBS: DISABLED Realsense camera plugin support") + obs_status(DISABLED "Realsense camera plugin support") return() endif() @@ -10,7 +10,7 @@ project(win-ivcam) find_package(RSSDK REQUIRED) if(NOT TARGET RSS::SDK) - message(FATAL_ERROR "OBS: - RSSDK not found") + obs_status(FATAL_ERROR "win-ivcam -> RSSDK not found.") endif() include(IDLFileHelper)