Automatic macOS builds allow building OBS with minimal input and setup - necessary dependencies are installed automatically, build flags use a sane default and the generated OBS build uses the application's full feature set.
xcode-select --install
in Terminal, orNOTE: Automatic build scripts use Homebrew to automatically install additional build dependencies. If Homebrew is already installed on the system, that Homebrew environment will be used.
Clone the repository including submodules:
git clone --recursive https://github.com/obsproject/obs-studio.git
To do a fully automated build, open Terminal, switch to the checkout directory then run one of the following commands:
# Download and set up dependencies, then build OBS for local host
# architecture with common feature set
CI/build-macos.sh
# Skip download and setup of dendencies
CI/build-macos.sh --skip-dependency-checks
# Create a relocatable OBS.app application bundle
CI/build-macos.sh --bundle
# Create a distributable disk image
CI/build-macos.sh --package
# Ask for and use available developer ID for codesigning
CI/build-macos.sh --codesign
# Notarize application bundle or distributable disk image
CI/build-macos.sh --notarize
# Compile and package a codesigned and notarized build of OBS
CI/build-macos.sh --package --notarize
# Create a relocatable and codesigned OBS.app application bundle without
# checking for dependencies
CI/build-macos.sh --skip-dependency-checks --codesign --bundle
# Show all available options
CI/build-macos.sh --help
Custom macOS builds allow full customization of the desired build configuration but also require manual setup and preparation. Available CMake configuration variables can be found in the CMake build system documentation.
xcode-select --install
in Terminal, orFFmpeg
, x264
, mbedTLS
, Qt
and more)~/development/obs-build-dependencies/obs-deps
git clone --recursive https://github.com/obsproject/obs-studio.git
(If you do not know what submodules are, or you are not using Git from the command line, PLEASE make sure to fetch the submodules too.)
CI/macos/01_install_dependencies.sh
from the checkout directory (run it with the --help
switch to see all available options). NOTE: The directory where the script will download and setup the dependencies in cannot be changed.
Switch to the directory where the pre-compiled Chromium Embedded Framework was downloaded and extracted
Fix the CMake build scripts:
/usr/bin/sed -i '.orig' '/add_subdirectory(tests\/ceftests)/d' ./CMakeLists.txt
/usr/bin/sed -E -i '' 's/"10.(9|10)"/"'10.13'"/' ./cmake/cef_variables.cmake
Run CMake to generate the build scripts for the static wrapper library:
cmake -S . -B build -G Ninja \
-DPROJECT_ARCH=x86_64 \
-DCEF_COMPILER_FLAGS="-Wno-deprecated-copy" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++ -Wno-deprecated-declarations -Wno-unknown-warning-option" \
-DCMAKE_EXE_LINKER_FLAGS="-std=c++11 -stdlib=libc++" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13
Build the static wrapper library by running cmake --build build
NOTE: This build requirement can be disabled by setting -DENABLE_BROWSER_SOURCE
to OFF
in the next step.
cmake -S . -B build -G Xcode \
-DCEF_ROOT_DIR="~/development/obs-build-dependencies/cef_binary_5060_macos_x86_64" \
-DCMAKE_PREFIX_PATH="~/development/obs-build-dependencies/obs-deps" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-DCMAKE_OSX_ARCHITECTURES="x86_64"
Optional Settings:
-DOBS_BUNDLE_CODESIGN_IDENTITY="[YOUR_IDENTITY]"
or a team using -DOBS_BUNDLE_CODESIGN_TEAM="[YOUR_TEAM_ID]"
-DCMAKE_INSTALL_PREFIX=[YOUR INSTALL DESTINATION]
.-G Ninja
or -G 'Unix Makefiles'
-DCMAKE_BUILD_TYPE=RelWithDebInfo
obs-studio.xcodeproj
from the build directory (or any other directory specified via the -B
switch above)obs
schema, recognisable by the OBS Studio app icon.
Installation will use the directory specified via -DCMAKE_INSTALL_PREFIX
or can be customised with the --prefix
switch for Ninja-based builds.
If using Xcode:
install
schemaIf using the command line (Xcode, Ninja, or GNU Makefiles):
cmake --build build
cmake --install build