Merge pull request #5155 from PatTheMav/universal-build

CI: Add capability for native Apple Silicon and Universal binary builds
This commit is contained in:
Jim 2022-03-17 06:57:28 -07:00 committed by GitHub
commit 188347d69e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
273 changed files with 13524 additions and 10694 deletions

14
.cmake-format.json Normal file
View File

@ -0,0 +1,14 @@
{
"additional_commands": {
"find_qt": {
"flags": [],
"kwargs": {
"VERSION": "+",
"COMPONENTS": "+",
"COMPONENTS_WIN": "+",
"COMPONENTS_MACOS": "+",
"COMPONENTS_LINUX": "+"
}
}
}
}

View File

@ -1,6 +1,12 @@
name: Clang Format Check
on: [push, pull_request]
on:
push:
paths-ignore: ['**.md']
branches-ignore: [master]
pull_request:
paths-ignore: ['**.md']
branches-ignore: [master]
jobs:
clang-format-check:
@ -15,7 +21,7 @@ jobs:
run: |
sudo apt-get install -y clang-format-12
- name: Check the Formatting
- name: 'Run clang-format'
run: |
./formatcode.sh
./CI/check-format.sh
./CI/check-changes.sh

View File

@ -3,12 +3,6 @@
name: Flatpak
on:
push:
paths-ignore: ['**.md']
branches: [master, 'release/**']
pull_request:
paths-ignore: ['**.md']
branches: [master, 'release/**']
release:
types: [published]
branches: [master, 'release/**']
@ -24,44 +18,10 @@ env:
YOUTUBE_SECRET_HASH: ${{ secrets.YOUTUBE_SECRET_HASH }}
jobs:
generate_bundle:
name: Generate Flatpak Bundle
runs-on: [ubuntu-latest]
if: github.event_name != 'release'
container:
image: bilelmoussaoui/flatpak-github-actions:kde-5.15-21.08
options: --privileged
steps:
- name: 'Check for Github Labels'
if: github.event_name == 'pull_request'
shell: bash
run: |
LABELS_URL="$(echo ${{ github.event.pull_request.url }} | sed s'/pulls/issues/')"
LABEL_FOUND="$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "${LABELS_URL}/labels" | sed -n 's/.*"name": "\(.*\)",/\1/p' | grep 'Seeking Testers' || true)"
if [ "${LABEL_FOUND}" = "Seeking Testers" ]; then
echo "SEEKING_TESTERS=1" >> $GITHUB_ENV
else
echo "SEEKING_TESTERS=0" >> $GITHUB_ENV
fi
- name: Checkout
uses: actions/checkout@v2.3.3
if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1')
with:
submodules: 'recursive'
- name: Build Flatpak Manifest
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1')
with:
bundle: obs-studio-${{ github.sha }}.flatpak
manifest-path: CI/flatpak/com.obsproject.Studio.json
cache-key: flatpak-builder-${{ github.sha }}
publish:
name: Publish to Flathub
runs-on: [ubuntu-latest]
if: github.event_name == 'release'
if: "${{ github.event_name == 'release' && ( matrix.branch != 'stable' || (!contains(github.ref, '-beta') && !contains(github.ref, '-rc')) ) }}"
env:
FLATPAK_BUILD_PATH: flatpak_app/files/share
container:
@ -71,21 +31,13 @@ jobs:
matrix:
branch: [stable, beta]
steps:
- name: Check if job should run
id: should_run
if: "${{ matrix.branch != 'stable' || (!contains(github.ref, '-beta') && !contains(github.ref, '-rc')) }}"
run: |
echo "::set-output name=should_run::yes"
- name: Checkout
uses: actions/checkout@v2.3.3
if: steps.should_run.outputs.should_run == 'yes'
with:
submodules: 'recursive'
- name: Build Flatpak Manifest
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@master
if: steps.should_run.outputs.should_run == 'yes'
with:
bundle: obs-studio-${{ github.sha }}.flatpak
manifest-path: CI/flatpak/com.obsproject.Studio.json
@ -96,26 +48,23 @@ jobs:
- name: Validate AppStream
shell: bash
working-directory: ${{ env.FLATPAK_BUILD_PATH }}
if: steps.should_run.outputs.should_run == 'yes'
run: |
appstream-util validate appdata/com.obsproject.Studio.appdata.xml
- name: Verify icon and metadata in app-info
shell: bash
working-directory: ${{ env.FLATPAK_BUILD_PATH }}
if: steps.should_run.outputs.should_run == 'yes'
run: |
test -f app-info/icons/flatpak/128x128/com.obsproject.Studio.png || { echo "Missing 128x128 icon in app-info" ; exit 1; }
test -f app-info/xmls/com.obsproject.Studio.xml.gz || { echo "Missing com.obsproject.Studio.xml.gz in app-info" ; exit 1; }
- name: Commit screenshots to the OSTree repository
if: steps.should_run.outputs.should_run == 'yes'
run: |
ostree commit --repo=repo --canonical-permissions --branch=screenshots/x86_64 flatpak_app/screenshots
- name: Publish to Flathub Beta
uses: bilelmoussaoui/flatpak-github-actions/flat-manager@v4
if: steps.should_run.outputs.should_run == 'yes' && matrix.branch == 'beta'
if: matrix.branch == 'beta'
with:
flat-manager-url: https://hub.flathub.org/
repository: beta
@ -123,7 +72,7 @@ jobs:
- name: Publish to Flathub
uses: bilelmoussaoui/flatpak-github-actions/flat-manager@v4
if: steps.should_run.outputs.should_run == 'yes' && matrix.branch == 'stable'
if: matrix.branch == 'stable'
with:
flat-manager-url: https://hub.flathub.org/
repository: stable

File diff suppressed because it is too large Load Diff

5
.gitignore vendored
View File

@ -21,9 +21,11 @@
*.ninja
.ninja*
.dirstamp
/cmake/.CMakeBuildNumber
#xcode
*.xcodeproj/
/xcodebuild/
#clion
.idea/
@ -39,8 +41,7 @@ GeneratedFiles/
.moc/
/UI/obs.rc
.vscode/
/CI/include/*.lock.json
/other/

View File

@ -1,3 +0,0 @@
robocopy .\build32\rundir\RelWithDebInfo .\build\ /E /XF .gitignore
robocopy .\build64\rundir\RelWithDebInfo .\build\ /E /XC /XN /XO /XF .gitignore
7z a build.zip .\build\*

View File

@ -1,6 +0,0 @@
#!/bin/bash
set -ex
ccache -s || echo "CCache is not available."
mkdir build && cd build
cmake -DENABLE_PIPEWIRE=OFF -DBUILD_BROWSER=ON -DCEF_ROOT_DIR="../cef_binary_${LINUX_CEF_BUILD_VERSION}_linux64" ..

98
CI/build-freebsd.sh Executable file
View File

@ -0,0 +1,98 @@
#!/usr/bin/env bash
##############################################################################
# FreeBSD full build script
##############################################################################
#
# This script contains all steps necessary to:
#
# * Build OBS with all default plugins and dependencies
# * Package a FreeBSD package
#
# Parameters:
# -h, --help : Print usage help
# -q, --quiet : Suppress most build process output
# -v, --verbose : Enable more verbose build process output
# -d, --skip-dependency-checks : Skip dependency checks (default: off)
# -p, --portable : Create portable build (default: off)
# -pkg, --package : Create distributable archive
# (default: off)
# --build-dir : Specify alternative build directory
# (default: build)"
#
##############################################################################
# Halt on errors
set -eE
## SET UP ENVIRONMENT ##
_RUN_OBS_BUILD_SCRIPT=TRUE
PRODUCT_NAME="OBS-Studio"
CHECKOUT_DIR="$(git rev-parse --show-toplevel)"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
source "${CHECKOUT_DIR}/CI/include/build_support.sh"
source "${CHECKOUT_DIR}/CI/include/build_support_freebsd.sh"
## DEPENDENCY INSTALLATION
source "${CHECKOUT_DIR}/CI/freebsd/01_install_dependencies.sh"
## BUILD OBS ##
source "${CHECKOUT_DIR}/CI/freebsd/02_build_obs.sh"
## PACKAGE OBS AND NOTARIZE ##
source "${CHECKOUT_DIR}/CI/freebsd/03_package_obs.sh"
## MAIN SCRIPT FUNCTIONS ##
print_usage() {
echo "build-linux.sh - Build script for OBS-Studio\n"
echo -e "Usage: ${0}\n" \
"-h, --help : Print this help\n" \
"-q, --quiet : Suppress most build process output\n" \
"-v, --verbose : Enable more verbose build process output\n" \
"-d, --skip-dependency-checks : Skip dependency checks (default: off)\n" \
"-p, --portable : Create portable build (default: off)\n" \
"-pkg, --package : Create distributable disk image (default: off)\n" \
"--build-dir : Specify alternative build directory (default: build)\n"
}
obs-build-main() {
while true; do
case "${1}" in
-h | --help ) print_usage; exit 0 ;;
-q | --quiet ) export QUIET=TRUE; shift ;;
-v | --verbose ) export VERBOSE=TRUE; shift ;;
-d | --skip-dependency-checks ) SKIP_DEP_CHECKS=TRUE; shift ;;
-p | --portable ) PORTABLE=TRUE; shift ;;
-pkg | --package ) PACKAGE=TRUE; shift ;;
--disable-pipewire ) DISABLE_PIPEWIRE=TRUE; shift ;;
--build-dir ) BUILD_DIR="${2}"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done
ensure_dir "${CHECKOUT_DIR}"
step "Fetching OBS tags..."
git fetch origin --tags
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
GIT_HASH=$(git rev-parse --short HEAD)
GIT_TAG=$(git describe --tags --abbrev=0)
FILE_NAME="obs-studio-${GIT_TAG}-${GIT_HASH}-FreeBSD"
if [ -z "${SKIP_DEP_CHECKS}" ]; then
install_dependencies
fi
build_obs
if [ "${PACKAGE}" ]; then
package_obs
fi
cleanup
}
obs-build-main $*

105
CI/build-linux.sh Executable file
View File

@ -0,0 +1,105 @@
#!/bin/bash
##############################################################################
# Linux full build script
##############################################################################
#
# This script contains all steps necessary to:
#
# * Build OBS with all default plugins and dependencies
# * Package a Linux deb package
#
# Parameters:
# -h, --help : Print usage help
# -q, --quiet : Suppress most build process output
# -v, --verbose : Enable more verbose build process output
# -d, --skip-dependency-checks : Skip dependency checks (default: off)
# -p, --portable : Create portable build (default: off)
# -pkg, --package : Create distributable disk image
# (default: off)
# --build-dir : Specify alternative build directory
# (default: build)"
#
##############################################################################
# Halt on errors
set -eE
## SET UP ENVIRONMENT ##
_RUN_OBS_BUILD_SCRIPT=TRUE
PRODUCT_NAME="OBS-Studio"
CHECKOUT_DIR="$(git rev-parse --show-toplevel)"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
source "${CHECKOUT_DIR}/CI/include/build_support.sh"
source "${CHECKOUT_DIR}/CI/include/build_support_linux.sh"
## DEPENDENCY INSTALLATION
source "${CHECKOUT_DIR}/CI/linux/01_install_dependencies.sh"
## BUILD OBS ##
source "${CHECKOUT_DIR}/CI/linux/02_build_obs.sh"
## PACKAGE OBS AND NOTARIZE ##
source "${CHECKOUT_DIR}/CI/linux/03_package_obs.sh"
## MAIN SCRIPT FUNCTIONS ##
print_usage() {
echo "build-linux.sh - Build script for OBS-Studio\n"
echo -e "Usage: ${0}\n" \
"-h, --help : Print this help\n" \
"-q, --quiet : Suppress most build process output\n" \
"-v, --verbose : Enable more verbose build process output\n" \
"-d, --skip-dependency-checks : Skip dependency checks (default: off)\n" \
"-p, --portable : Create portable build (default: off)\n" \
"-pkg, --package : Create distributable disk image (default: off)\n" \
"--disable-pipewire : Disable building with Pipewire support (default: off)\n" \
"--build-dir : Specify alternative build directory (default: build)\n"
}
obs-build-main() {
while true; do
case "${1}" in
-h | --help ) print_usage; exit 0 ;;
-q | --quiet ) export QUIET=TRUE; shift ;;
-v | --verbose ) export VERBOSE=TRUE; shift ;;
-d | --skip-dependency-checks ) SKIP_DEP_CHECKS=TRUE; shift ;;
-p | --portable ) PORTABLE=TRUE; shift ;;
-pkg | --package ) PACKAGE=TRUE; shift ;;
--disable-pipewire ) DISABLE_PIPEWIRE=TRUE; shift ;;
--build-dir ) BUILD_DIR="${2}"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done
ensure_dir "${CHECKOUT_DIR}"
step "Fetching OBS tags..."
git fetch origin --tags
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
GIT_HASH=$(git rev-parse --short HEAD)
GIT_TAG=$(git describe --tags --abbrev=0)
if [ "${BUILD_FOR_DISTRIBUTION}" ]; then
VERSION_STRING="${GIT_TAG}"
else
VERSION_STRING="${GIT_TAG}-${GIT_HASH}"
fi
FILE_NAME="obs-studio-${VERSION_STRING}-Linux.deb"
if [ -z "${SKIP_DEP_CHECKS}" ]; then
install_dependencies
fi
build_obs
if [ "${PACKAGE}" ]; then
package_obs
fi
cleanup
}
obs-build-main $*

157
CI/build-macos.sh Executable file
View File

@ -0,0 +1,157 @@
#!/bin/bash
##############################################################################
# macOS build script
##############################################################################
#
# This script contains all steps necessary to:
#
# * Build OBS with all default plugins and dependencies
# * Create a macOS application bundle
# * Codesign the macOS application bundle
# * Package a macOS installation image
# * Notarize macOS application bundle and/or installation image
#
# Parameters:
# -h, --help : Print usage help
# -q, --quiet : Suppress most build process output
# -v, --verbose : Enable more verbose build process output
# -d, --skip-dependency-checks : Skip dependency checks (default: off)
# -b, --bundle : Create relocatable application bundle
# (default: off)
# -p, --package : Create distributable disk image
# (default: off)
# -c, --codesign : Codesign OBS and all libraries
# (default: ad-hoc only)
# -n, --notarize : Notarize OBS (default: off)
# --xcode : Create Xcode build environment instead
# of Ninja
# --build-dir : Specify alternative build directory
# (default: build)"
# Environment Variables (optional):
#
# MACOS_DEPS_VERSION : Precompiled macOS dependencies version
# MACOS_CEF_BUILD_VERSION : Chromium Embedded Framework version
# VLC_VERSION : VLC version
# SPARKLE_VERSION : Sparkle Framework version
#
##############################################################################
# Halt on errors
set -eE
## SET UP ENVIRONMENT ##
_RUN_OBS_BUILD_SCRIPT=TRUE
PRODUCT_NAME="OBS-Studio"
CHECKOUT_DIR="$(/usr/bin/git rev-parse --show-toplevel)"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
source "${CHECKOUT_DIR}/CI/include/build_support.sh"
source "${CHECKOUT_DIR}/CI/include/build_support_macos.sh"
## INSTALL DEPENDENCIES ##
source "${CHECKOUT_DIR}/CI/macos/01_install_dependencies.sh"
## BUILD OBS ##
source "${CHECKOUT_DIR}/CI/macos/02_build_obs.sh"
## PACKAGE OBS AND NOTARIZE ##
source "${CHECKOUT_DIR}/CI/macos/03_package_obs.sh"
## MAIN SCRIPT FUNCTIONS ##
print_usage() {
echo "build-macos.sh - Build script for OBS-Studio"
echo -e "Usage: ${0}\n" \
"-h, --help : Print this help\n" \
"-q, --quiet : Suppress most build process output\n" \
"-v, --verbose : Enable more verbose build process output\n" \
"-a, --architecture : Specify build architecture (default: x86_64, alternative: arm64)\n" \
"-d, --skip-dependency-checks : Skip dependency checks (default: off)\n" \
"-b, --bundle : Create relocatable application bundle (default: off)\n" \
"-p, --package : Create distributable disk image (default: off)\n" \
"-c, --codesign : Codesign OBS and all libraries (default: ad-hoc only)\n" \
"-n, --notarize : Notarize OBS (default: off)\n" \
"--xcode : Create Xcode build environment instead of Ninja\n" \
"--build-dir : Specify alternative build directory (default: build)\n"
}
print_deprecation() {
echo -e "DEPRECATION ERROR:\n" \
"The '${1}' switch has been deprecated!\n"
if [ "${1}" = "-s" ]; then
echo -e "The macOS build script system has changed:\n" \
" - To configure and build OBS, run the script 'CI/macos/02_build_obs.sh'\n" \
" - To bundle OBS into a relocatable application bundle, run the script 'CI/macos/02_build_obs.sh --bundle\n" \
" - To package OBS, run the script 'CI/macos/03_package_obs.sh'\n" \
" - To notarize OBS, run the script 'CI/macos/03_package_obs.sh --notarize'\n"
fi
}
obs-build-main() {
while true; do
case "${1}" in
-h | --help ) print_usage; exit 0 ;;
-q | --quiet ) export QUIET=TRUE; shift ;;
-v | --verbose ) export VERBOSE=TRUE; shift ;;
-a | --architecture ) ARCH="${2}"; shift 2 ;;
-d | --skip-dependency-checks ) SKIP_DEP_CHECKS=TRUE; shift ;;
-p | --package ) PACKAGE=TRUE; shift ;;
-c | --codesign ) CODESIGN=TRUE; shift ;;
-n | --notarize ) NOTARIZE=TRUE; PACKAGE=TRUE CODESIGN=TRUE; shift ;;
-b | --bundle ) BUNDLE=TRUE; shift ;;
--xcode ) XCODE=TRUE; shift ;;
--build-dir ) BUILD_DIR="${2}"; shift 2 ;;
-s ) print_deprecation ${1}; exit 1 ;;
-- ) shift; break ;;
* ) break ;;
esac
done
ensure_dir "${CHECKOUT_DIR}"
check_archs
check_macos_version
step "Fetching OBS tags..."
/usr/bin/git fetch origin --tags
GIT_BRANCH=$(/usr/bin/git rev-parse --abbrev-ref HEAD)
GIT_HASH=$(/usr/bin/git rev-parse --short HEAD)
GIT_TAG=$(/usr/bin/git describe --tags --abbrev=0)
if [ "${BUILD_FOR_DISTRIBUTION}" ]; then
VERSION_STRING="${GIT_TAG}"
else
VERSION_STRING="${GIT_TAG}-${GIT_HASH}"
fi
if [ "${ARCH}" = "arm64" ]; then
FILE_NAME="obs-studio-${VERSION_STRING}-macOS-Apple.dmg"
elif [ "${ARCH}" = "universal" ]; then
FILE_NAME="obs-studio-${VERSION_STRING}-macOS.dmg"
else
FILE_NAME="obs-studio-${VERSION_STRING}-macOS-Intel.dmg"
fi
if [ -z "${SKIP_DEP_CHECKS}" ]; then
install_dependencies
fi
build_obs
if [ "${BUNDLE}" ]; then
bundle_obs
fi
if [ "${PACKAGE}" ]; then
package_obs
fi
if [ "${NOTARIZE}" ]; then
notarize_obs
fi
cleanup
}
obs-build-main $*

137
CI/build-windows.ps1 Normal file
View File

@ -0,0 +1,137 @@
Param(
[Switch]$Help,
[Switch]$Quiet,
[Switch]$Verbose,
[Switch]$Package,
[Switch]$SkipDependencyChecks,
[Switch]$BuildInstaller,
[Switch]$CombinedArchs,
[String]$BuildDirectory = "build",
[ValidateSet("32-bit", "64-bit")]
[String]$BuildArch = (Get-CimInstance CIM_OperatingSystem).OSArchitecture,
[ValidateSet("Release", "RelWithDebInfo", "MinSizeRel", "Debug")]
[String]$BuildConfiguration = "RelWithDebInfo"
)
##############################################################################
# Windows OBS build script
##############################################################################
#
# This script contains all steps necessary to:
#
# * Build OBS with all required dependencies
# * Create 64-bit and 32-bit variants
#
# Parameters:
# -Help : Print usage help
# -Quiet : Suppress most build process output
# -Verbose : Enable more verbose build process output
# -SkipDependencyChecks : Skip dependency checks
# -BuildDirectory : Directory to use for builds
# Default: build64 on 64-bit systems
# build32 on 32-bit systems
# -BuildArch : Build architecture to use ("32-bit" or "64-bit")
# -BuildConfiguration : Build configuration to use
# Default: RelWithDebInfo
# -CombinedArchs : Create combined packages and installer
# (64-bit and 32-bit) - Default: off
# -Package : Prepare folder structure for installer creation
#
# Environment Variables (optional):
# WindowsDepsVersion : Pre-compiled Windows dependencies version
# WindowsQtVersion : Pre-compiled Qt version
#
##############################################################################
$ErrorActionPreference = "Stop"
$_RunObsBuildScript = $true
$ProductName = "OBS-Studio"
$CheckoutDir = Resolve-Path -Path "$PSScriptRoot\.."
$DepsBuildDir = "${CheckoutDir}/../obs-build-dependencies"
$ObsBuildDir = "${CheckoutDir}/../obs-studio"
. ${CheckoutDir}/CI/include/build_support_windows.ps1
# Handle installation of build system components and build dependencies
. ${CheckoutDir}/CI/windows/01_install_dependencies.ps1
# Handle OBS build configuration
. ${CheckoutDir}/CI/windows/02_build_obs.ps1
# Handle packaging
. ${CheckoutDir}/CI/windows/03_package_obs.ps1
function Build-OBS-Main {
Ensure-Directory ${CheckoutDir}
Write-Step "Fetching version tags..."
$null = git fetch origin --tags
$GitBranch = git rev-parse --abbrev-ref HEAD
$GitHash = git rev-parse --short HEAD
$ErrorActionPreference = "SilentlyContinue"
$GitTag = git describe --tags --abbrev=0
$ErrorActionPreference = "Stop"
if(Test-Path variable:BUILD_FOR_DISTRIBUTION) {
$VersionString = "${GitTag}"
} else {
$VersionString = "${GitTag}-${GitHash}"
}
$FileName = "${ProductName}-${VersionString}"
if($CombinedArchs.isPresent) {
if (!(Test-Path env:obsInstallerTempDir)) {
$Env:obsInstallerTempDir = "${CheckoutDir}/install_temp"
}
if(!($SkipDependencyChecks.isPresent)) {
Install-Dependencies -BuildArch 64-bit
}
Build-OBS -BuildArch 64-bit
if(!($SkipDependencyChecks.isPresent)) {
Install-Dependencies -BuildArch 32-bit
}
Build-OBS -BuildArch 32-bit
} else {
if(!($SkipDependencyChecks.isPresent)) {
Install-Dependencies
}
Build-OBS
}
if($Package.isPresent) {
Package-OBS -CombinedArchs:$CombinedArchs
}
}
## MAIN SCRIPT FUNCTIONS ##
function Print-Usage {
Write-Host "build-windows.ps1 - Build script for ${ProductName}"
$Lines = @(
"Usage: ${_ScriptName}",
"-Help : Print this help",
"-Quiet : Suppress most build process output"
"-Verbose : Enable more verbose build process output"
"-SkipDependencyChecks : Skip dependency checks - Default: off",
"-BuildDirectory : Directory to use for builds - Default: build64 on 64-bit systems, build32 on 32-bit systems",
"-BuildArch : Build architecture to use ('32-bit' or '64-bit') - Default: local architecture",
"-BuildConfiguration : Build configuration to use - Default: RelWithDebInfo",
"-CombinedArchs : Create combined packages and installer (64-bit and 32-bit) - Default: off"
"-Package : Prepare folder structure for installer creation"
)
$Lines | Write-Host
}
$_ScriptName = "$($MyInvocation.MyCommand.Name)"
if($Help.isPresent) {
Print-Usage
exit 0
}
Build-OBS-Main

11
CI/check-changes.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
dirty=$(git ls-files --modified)
set +x
if [[ $dirty ]]; then
echo "================================="
echo "Files were not formatted properly"
echo "$dirty"
echo "================================="
exit 1
fi

51
CI/check-cmake.sh Executable file
View File

@ -0,0 +1,51 @@
#!/usr/bin/env bash
set -o errexit
set -o pipefail
if [ ${#} -eq 1 -a "${1}" = "VERBOSE" ]; then
VERBOSITY="-l debug"
else
VERBOSITY=""
fi
if [ "${CI}" ]; then
MODE="--check"
else
MODE="-i"
fi
# Runs the formatter in parallel on the code base.
# Return codes:
# - 1 there are files to be formatted
# - 0 everything looks fine
# Get CPU count
OS=$(uname)
NPROC=1
if [[ ${OS} = "Linux" ]] ; then
NPROC=$(nproc)
elif [[ ${OS} = "Darwin" ]] ; then
NPROC=$(sysctl -n hw.physicalcpu)
fi
# Discover clang-format
if ! type cmake-format 2> /dev/null ; then
echo "Required cmake-format not found"
exit 1
fi
find . -type d \( \
-path ./\*build -o \
-path ./deps/jansson -o \
-path ./plugins/decklink/\*/decklink-sdk -o \
-path ./plugins/enc-amf -o \
-path ./plugins/mac-syphon/syphon-framework -o \
-path ./plugins/obs-outputs/ftl-sdk -o \
-path ./plugins/obs-vst -o \
-path ./plugins/obs-browser -o \
-path ./plugins/win-dshow/libdshowcapture \
\) -prune -false -type f -o \
-name 'CMakeLists.txt' -or \
-name '*.cmake' \
| xargs -L10 -P ${NPROC} cmake-format ${MODE} ${VERBOSITY}

View File

@ -1,11 +1,60 @@
#!/bin/bash
dirty=$(git ls-files --modified)
#!/usr/bin/env bash
# Original source https://github.com/Project-OSRM/osrm-backend/blob/master/scripts/format.sh
set +x
if [[ $dirty ]]; then
echo "================================="
echo "Files were not formatted properly"
echo "$dirty"
echo "================================="
set -o errexit
set -o pipefail
set -o nounset
if [ ${#} -eq 1 ]; then
VERBOSITY="--verbose"
else
VERBOSITY=""
fi
# Runs the Clang Formatter in parallel on the code base.
# Return codes:
# - 1 there are files to be formatted
# - 0 everything looks fine
# Get CPU count
OS=$(uname)
NPROC=1
if [[ ${OS} = "Linux" ]] ; then
NPROC=$(nproc)
elif [[ ${OS} = "Darwin" ]] ; then
NPROC=$(sysctl -n hw.physicalcpu)
fi
# Discover clang-format
if type clang-format-12 2> /dev/null ; then
CLANG_FORMAT=clang-format-12
elif type clang-format 2> /dev/null ; then
# Clang format found, but need to check version
CLANG_FORMAT=clang-format
V=$(clang-format --version)
if [[ $V != *"version 12.0"* ]]; then
echo "clang-format is not 12.0 (returned ${V})"
exit 1
fi
else
echo "No appropriate clang-format found (expected clang-format-12.0.0, or clang-format)"
exit 1
fi
fi
find . -type d \( \
-path ./\*build -o \
-path ./cmake -o \
-path ./deps -o \
-path ./plugins/decklink/\*/decklink-sdk -o \
-path ./plugins/enc-amf -o \
-path ./plugins/mac-syphon/syphon-framework -o \
-path ./plugins/obs-outputs/ftl-sdk -o \
-path ./plugins/obs-vst \
\) -prune -false -type f -o \
-name '*.h' -or \
-name '*.hpp' -or \
-name '*.m' -or \
-name '*.m,' -or \
-name '*.c' -or \
-name '*.cpp' \
| xargs -L100 -P ${NPROC} ${CLANG_FORMAT} ${VERBOSITY} -i -style=file -fallback-style=none

View File

@ -416,13 +416,14 @@
"config-opts": [
"-DCMAKE_BUILD_TYPE=Release",
"-DENABLE_WAYLAND=ON",
"-DBUILD_BROWSER=ON",
"-DENABLE_BROWSER=ON",
"-DCEF_ROOT_DIR=/app/cef",
"-DUNIX_STRUCTURE=ON",
"-DUSE_XDG=ON",
"-DDISABLE_ALSA=ON",
"-DENABLE_ALSA=OFF",
"-DENABLE_PULSEAUDIO=ON",
"-DWITH_RTMPS=ON"
"-DENABLE_RTMPS=ON",
"-DENABLE_VLC=OFF",
"-DENABLE_AJA=OFF"
],
"secret-opts": [
"-DRESTREAM_CLIENTID=$RESTREAM_CLIENTID",

View File

@ -0,0 +1,100 @@
#!/usr/bin/env bash
##############################################################################
# FreeBSD dependency management function
##############################################################################
#
# This script file can be included in build scripts or run directly
#
##############################################################################
# Halt on errors
set -eE
install_build-deps() {
shift
status "Install OBS build dependencies"
trap "caught_error 'install_build-deps'" ERR
sudo pkg install -U -y $@
}
install_obs-deps() {
shift
status "Install OBS dependencies"
trap "caught_error 'install_obs-deps'" ERR
sudo pkg install -U -y $@
}
install_qt-deps() {
shift
status "Install Qt dependencies"
trap "caught_error 'install_qt-deps'" ERR
sudo pkg install -U -y $@
}
install_plugin-deps() {
shift
status "Install plugin dependencies"
trap "caught_error 'install_plugin-deps'" ERR
sudo pkg install -U -y $@
}
install_dependencies() {
status "Set up apt"
trap "caught_error 'install_dependencies'" ERR
BUILD_DEPS=(
"build-deps cmake ninja pkgconf curl ccache"
"obs-deps ffmpeg libx264 mbedtls mesa-libs jansson lua52 luajit python37 libX11 xorgproto libxcb \
libXcomposite libXext libXfixes libXinerama libXrandr swig dbus jansson libICE libSM libsysinfo"
"qt-deps qt5-buildtools qt5-qmake qt5-imageformats qt5-core qt5-gui qt5-svg qt5-widgets qt5-xml"
"plugin-deps v4l_compat fdk-aac fontconfig freetype2 speexdsp libudev-devd libv4l vlc audio/jack pulseaudio sndio"
)
for DEPENDENCY in "${BUILD_DEPS[@]}"; do
set -- ${DEPENDENCY}
trap "caught_error ${DEPENDENCY}" ERR
FUNC_NAME="install_${1}"
${FUNC_NAME} ${@}
done
}
install-dependencies-standalone() {
CHECKOUT_DIR="$(git rev-parse --show-toplevel)"
PRODUCT_NAME="OBS-Studio"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
source "${CHECKOUT_DIR}/CI/include/build_support.sh"
source "${CHECKOUT_DIR}/CI/include/build_support_freebsd.sh"
status "Setup of OBS build dependencies"
install_dependencies
}
print_usage() {
echo -e "Usage: ${0}\n" \
"-h, --help : Print this help\n" \
"-q, --quiet : Suppress most build process output\n" \
"-v, --verbose : Enable more verbose build process output\n"
}
install-dependencies-main() {
if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then
while true; do
case "${1}" in
-h | --help ) print_usage; exit 0 ;;
-q | --quiet ) export QUIET=TRUE; shift ;;
-v | --verbose ) export VERBOSE=TRUE; shift ;;
-- ) shift; break ;;
* ) break ;;
esac
done
install-dependencies-standalone
fi
}
install-dependencies-main $*

120
CI/freebsd/02_build_obs.sh Normal file
View File

@ -0,0 +1,120 @@
#!/usr/bin/env bash
##############################################################################
# FreeBSD build function
##############################################################################
#
# This script file can be included in build scripts for FreeBSD or run
# directly
#
##############################################################################
# Halt on errors
set -eE
build_obs() {
status "Build OBS"
if [ -z "${CI}" ]; then
_backup_artifacts
fi
step "Configure OBS..."
_configure_obs
ensure_dir "${CHECKOUT_DIR}/"
step "Build OBS targets..."
cmake --build ${BUILD_DIR}
}
# Function to configure OBS build
_configure_obs() {
ensure_dir "${CHECKOUT_DIR}"
status "Configuration of OBS build system..."
check_ccache
if [ "${TWITCH_CLIENTID}" -a "${TWICH_HASH}" ]; then
TWITCH_OPTIONS="-DTWITCH_CLIENTID=\"${TWITCH_CLIENTID}\" -DTWITCH_HASH=\"${TWITCH_HASH}\""
fi
if [ "${RESTREAM_CLIENTID}" -a "${RESTREAM_HASH}" ]; then
RESTREAM_OPTIONS="-DRESTREAM_CLIENTID=\"${RESTREAM_CLIENTID}\" -DRESTREAM_HASH=\"${RESTREAM_HASH}\""
fi
if [ "${YOUTUBE_CLIENTID}" -a "${YOUTUBE_CLIENTID_HASH}" -a "${YOUTUBE_SECRET}" -a "{YOUTUBE_SECRET_HASH}" ]; then
YOUTUBE_OPTIONS="-DYOUTUBE_CLIENTID=\"${YOUTUBE_CLIENTID}\" -DYOUTUBE_CLIENTID_HASH=\"${YOUTUBE_CLIENTID_HASH}\" -DYOUTUBE_SECRET=\"${YOUTUBE_SECRET}\" -DYOUTUBE_SECRET_HASH=\"${YOUTUBE_SECRET_HASH}\""
fi
if [ "${PORTABLE}" ]; then
PORTABLE_BUILD="ON"
fi
cmake -S . -B ${BUILD_DIR} -G Ninja \
-DCMAKE_BUILD_TYPE=${BUILD_CONFIG} \
-DLINUX_PORTABLE=${PORTABLE_BUILD:-OFF} \
-DENABLE_PIPEWIRE=OFF \
${CCACHE_OPTIONS} \
${TWITCH_OPTIONS} \
${YOUTUBE_OPTIONS} \
${RESTREAM_OPTIONS} \
${CI:+-DENABLE_UNIT_TESTS=ON -DBUILD_FOR_DISTRIBUTION=${BUILD_FOR_DISTRIBUTION} -DOBS_BUILD_NUMBER=${GITHUB_RUN_ID}} \
${QUIET:+-Wno-deprecated -Wno-dev --log-level=ERROR}
}
# Function to backup previous build artifacts
_backup_artifacts() {
ensure_dir "${CHECKOUT_DIR}"
if [ -d "${BUILD_DIR}" ]; then
status "Backup of old OBS build artifacts"
CUR_DATE=$(/bin/date +"%Y-%m-%d@%H%M%S")
NIGHTLY_DIR="${CHECKOUT_DIR}/nightly-${CUR_DATE}"
PACKAGE_NAME=$(/usr/bin/find ${BUILD_DIR} -maxdepth 1 -name "*.tar.gz" | sort -rn | head -1)
if [ "${PACKAGE_NAME}" ]; then
step "Back up $(basename "${PACKAGE_NAME}")..."
ensure_dir "${NIGHTLY_DIR}"
ensure_dir "${CHECKOUT_DIR}"
/usr/bin/find "${BUILD_DIR}" -maxdepth 1 \( -name "obs-studio-*.sh" -o -name "obs-studio-*.tar.gz" -o -name "obs-studio-*.tar.Z" \) -print0 | /usr/bin/xargs -0 -I {} /bin/mv {} ${NIGHTLY_DIR}/
info "You can find $(basename "${PACKAGE_NAME}") in ${NIGHTLY_DIR}"
fi
fi
}
build-obs-standalone() {
CHECKOUT_DIR="$(git rev-parse --show-toplevel)"
PRODUCT_NAME="OBS-Studio"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
source "${CHECKOUT_DIR}/CI/include/build_support.sh"
source "${CHECKOUT_DIR}/CI/include/build_support_freebsd.sh"
build_obs
}
print_usage() {
echo -e "Usage: ${0}\n" \
"-h, --help : Print this help\n" \
"-q, --quiet : Suppress most build process output\n" \
"-v, --verbose : Enable more verbose build process output\n" \
"-p, --portable : Create portable build (default: off)\n" \
"--build-dir : Specify alternative build directory (default: build)\n"
}
build-obs-main() {
if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then
while true; do
case "${1}" in
-h | --help ) print_usage; exit 0 ;;
-q | --quiet ) export QUIET=TRUE; shift ;;
-v | --verbose ) export VERBOSE=TRUE; shift ;;
-p | --portable ) export PORTABLE=TRUE; shift ;;
--build-dir ) BUILD_DIR="${2}"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done
build-obs-standalone
fi
}
build-obs-main $*

View File

@ -0,0 +1,78 @@
#!/usr/bin/env bash
##############################################################################
# FreeBSD OBS package function
##############################################################################
#
# This script file can be included in build scripts for FreeBSD or run directly
#
##############################################################################
# Halt on errors
set -eE
package_obs() {
status "Create FreeBSD debian package"
trap "caught_error 'package app'" ERR
ensure_dir "${CHECKOUT_DIR}"
step "Package OBS..."
cmake --build ${BUILD_DIR} -t package
ZIP_NAME="$(/usr/bin/find "${BUILD_DIR}" -maxdepth 1 -type f -name "obs-studio-*.sh" | sort -rn | head -1)"
if [ "${ZIP_NAME}" ]; then
mv "${ZIP_NAME%.*}.sh" "${BUILD_DIR}/${FILE_NAME}.sh"
mv "${ZIP_NAME%.*}.tar.gz" "${BUILD_DIR}/${FILE_NAME}.tar.gz"
mv "${ZIP_NAME%.*}.tar.Z" "${BUILD_DIR}/${FILE_NAME}.tar.Z"
else
error "ERROR No suitable OBS debian package generated"
fi
}
package-obs-standalone() {
PRODUCT_NAME="OBS-Studio"
CHECKOUT_DIR="$(git rev-parse --show-toplevel)"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
source ${CHECKOUT_DIR}/CI/include/build_support.sh
source ${CHECKOUT_DIR}/CI/include/build_support_freebsd.sh
step "Fetch OBS tags..."
git fetch origin --tags
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
GIT_HASH=$(git rev-parse --short HEAD)
GIT_TAG=$(git describe --tags --abbrev=0)
FILE_NAME="obs-studio-${GIT_TAG}-${GIT_HASH}-FreeBSD"
package_obs
}
print_usage() {
echo -e "Usage: ${0}\n" \
"-h, --help : Print this help\n" \
"-q, --quiet : Suppress most build process output\n" \
"-v, --verbose : Enable more verbose build process output\n" \
"--build-dir : Specify alternative build directory (default: build)\n"
}
package-obs-main() {
if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then
while true; do
case "${1}" in
-h | --help ) print_usage; exit 0 ;;
-q | --quiet ) export QUIET=TRUE; shift ;;
-v | --verbose ) export VERBOSE=TRUE; shift ;;
--build-dir ) BUILD_DIR="${2}"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done
package-obs-standalone
fi
}
package-obs-main $*

View File

@ -1,726 +0,0 @@
#!/bin/bash
##############################################################################
# macOS full build script
##############################################################################
#
# This script contains all steps necessary to:
#
# * Build OBS with all default plugins and dependencies
# * Create a macOS application bundle
# * Code-sign the macOS application-bundle
# * Package a macOS installation image
# * Notarize macOS application-bundle and/or installation image
#
# Parameters:
# -b: Create macOS bundle
# -d: Skip dependency checks
# -p: Create macOS distribution image
# -n: Notarize macOS app and disk image (implies bundling)
# -s: Skip the build process (useful for bundling/packaging only)
# -h: Print usage help
#
# Environment Variables (optional):
# MACOS_DEPS_VERSION : Pre-compiled macOS dependencies version
# MACOS_CEF_BUILD_VERSION : Chromium Embedded Framework version
# VLC_VERISON : VLC version
# SPARKLE_VERSION : Sparke Framework version
# BUILD_DIR : Alternative directory to build OBS in
#
##############################################################################
# Halt on errors
set -eE
## SET UP ENVIRONMENT ##
PRODUCT_NAME="OBS-Studio"
CHECKOUT_DIR="$(/usr/bin/git rev-parse --show-toplevel)"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
BUILD_DIR="${BUILD_DIR:-build}"
BUILD_CONFIG=${BUILD_CONFIG:-RelWithDebInfo}
CI_SCRIPTS="${CHECKOUT_DIR}/CI/scripts/macos"
CI_WORKFLOW="${CHECKOUT_DIR}/.github/workflows/main.yml"
CI_MACOS_CEF_VERSION=$(/bin/cat "${CI_WORKFLOW}" | /usr/bin/sed -En "s/[ ]+MACOS_CEF_BUILD_VERSION: '([0-9]+)'/\1/p")
CI_DEPS_VERSION=$(/bin/cat "${CI_WORKFLOW}" | /usr/bin/sed -En "s/[ ]+MACOS_DEPS_VERSION: '([0-9\-]+)'/\1/p")
CI_VLC_VERSION=$(/bin/cat "${CI_WORKFLOW}" | /usr/bin/sed -En "s/[ ]+VLC_VERSION: '([0-9\.]+)'/\1/p")
CI_SPARKLE_VERSION=$(/bin/cat "${CI_WORKFLOW}" | /usr/bin/sed -En "s/[ ]+SPARKLE_VERSION: '([0-9\.]+)'/\1/p")
CI_QT_VERSION=$(/bin/cat "${CI_WORKFLOW}" | /usr/bin/sed -En "s/[ ]+QT_VERSION: '([0-9\.]+)'/\1/p" | /usr/bin/head -1)
CI_MIN_MACOS_VERSION=$(/bin/cat "${CI_WORKFLOW}" | /usr/bin/sed -En "s/[ ]+MIN_MACOS_VERSION: '([0-9\.]+)'/\1/p")
NPROC="${NPROC:-$(sysctl -n hw.ncpu)}"
CURRENT_ARCH=$(uname -m)
BUILD_DEPS=(
"obs-deps ${MACOS_DEPS_VERSION:-${CI_DEPS_VERSION}}"
"qt-deps ${QT_VERSION:-${CI_QT_VERSION}} ${MACOS_DEPS_VERSION:-${CI_DEPS_VERSION}}"
"cef ${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}}"
"vlc ${VLC_VERSION:-${CI_VLC_VERSION}}"
"sparkle ${SPARKLE_VERSION:-${CI_SPARKLE_VERSION}}"
)
if [ -n "${TERM-}" ]; then
COLOR_RED=$(/usr/bin/tput setaf 1)
COLOR_GREEN=$(/usr/bin/tput setaf 2)
COLOR_BLUE=$(/usr/bin/tput setaf 4)
COLOR_ORANGE=$(/usr/bin/tput setaf 3)
COLOR_RESET=$(/usr/bin/tput sgr0)
else
COLOR_RED=""
COLOR_GREEN=""
COLOR_BLUE=""
COLOR_ORANGE=""
COLOR_RESET=""
fi
MACOS_VERSION="$(/usr/bin/sw_vers -productVersion)"
MACOS_MAJOR="$(/bin/echo ${MACOS_VERSION} | /usr/bin/cut -d '.' -f 1)"
MACOS_MINOR="$(/bin/echo ${MACOS_VERSION} | /usr/bin/cut -d '.' -f 2)"
## DEFINE UTILITIES ##
hr() {
/bin/echo "${COLOR_BLUE}[${PRODUCT_NAME}] ${1}${COLOR_RESET}"
}
step() {
/bin/echo "${COLOR_GREEN} + ${1}${COLOR_RESET}"
}
info() {
/bin/echo "${COLOR_ORANGE} + ${1}${COLOR_RESET}"
}
error() {
/bin/echo "${COLOR_RED} + ${1}${COLOR_RESET}"
}
exists() {
/usr/bin/command -v "$1" >/dev/null 2>&1
}
ensure_dir() {
[[ -n "${1}" ]] && /bin/mkdir -p "${1}" && builtin cd "${1}"
}
cleanup() {
/bin/rm -rf "${CHECKOUT_DIR}/${BUILD_DIR}/settings.json"
unset CODESIGN_IDENT
unset CODESIGN_IDENT_USER
unset CODESIGN_IDENT_PASS
}
caught_error() {
error "ERROR during build step: ${1}"
cleanup
exit 1
}
## CHECK AND INSTALL DEPENDENCIES ##
check_macos_version() {
MIN_VERSION=${MIN_MACOS_VERSION:-${CI_MIN_MACOS_VERSION}}
MIN_MAJOR=$(/bin/echo ${MIN_VERSION} | /usr/bin/cut -d '.' -f 1)
MIN_MINOR=$(/bin/echo ${MIN_VERSION} | /usr/bin/cut -d '.' -f 2)
if [ "${MACOS_MAJOR}" -lt "11" ] && [ "${MACOS_MINOR}" -lt "${MIN_MINOR}" ]; then
error "WARNING: Minimum required macOS version is ${MIN_VERSION}, but running on ${MACOS_VERSION}"
fi
}
install_homebrew_deps() {
if ! exists brew; then
error "Homebrew not found - please install homebrew (https://brew.sh)"
exit 1
fi
if [ -d /usr/local/opt/openssl@1.0.2t ]; then
brew uninstall openssl@1.0.2t
brew untap local/openssl
fi
if [ -d /usr/local/opt/python@2.7.17 ]; then
brew uninstall python@2.7.17
brew untap local/python2
fi
brew bundle --file "${CI_SCRIPTS}/Brewfile"
check_curl
}
check_curl() {
if [ "${MACOS_MAJOR}" -lt "11" ] && [ "${MACOS_MINOR}" -lt "15" ]; then
if [ ! -d /usr/local/opt/curl ]; then
step "Installing Homebrew curl.."
brew install curl
fi
export CURLCMD="/usr/local/opt/curl/bin/curl"
else
export CURLCMD="curl"
fi
}
check_ccache() {
export PATH="/usr/local/opt/ccache/libexec:${PATH}"
CCACHE_STATUS=$(ccache -s >/dev/null 2>&1 && /bin/echo "CCache available." || /bin/echo "CCache is not available.")
info "${CCACHE_STATUS}"
}
install_obs-deps() {
hr "Setting up pre-built macOS OBS dependencies v${1}"
ensure_dir "${DEPS_BUILD_DIR}"
step "Download..."
${CURLCMD} --progress-bar -L -C - -O https://github.com/obsproject/obs-deps/releases/download/${1}/macos-deps-${1}-${CURRENT_ARCH}.tar.xz
step "Unpack..."
mkdir -p /tmp/obsdeps
/usr/bin/tar -xf "./macos-deps-${1}-${CURRENT_ARCH}.tar.xz" -C /tmp/obsdeps
/usr/bin/xattr -r -d com.apple.quarantine /tmp/obsdeps
}
install_qt-deps() {
hr "Setting up pre-built dependency QT v${1}"
ensure_dir "${DEPS_BUILD_DIR}"
step "Download..."
${CURLCMD} --progress-bar -L -C - -O https://github.com/obsproject/obs-deps/releases/download/${2}/macos-deps-qt-${2}-${CURRENT_ARCH}.tar.xz
step "Unpack..."
mkdir -p /tmp/obsdeps
/usr/bin/tar -xf ./macos-deps-qt-${2}-${CURRENT_ARCH}.tar.xz -C /tmp/obsdeps
/usr/bin/xattr -r -d com.apple.quarantine /tmp/obsdeps
}
install_vlc() {
hr "Setting up dependency VLC v${1}"
ensure_dir "${DEPS_BUILD_DIR}"
step "Download..."
${CURLCMD} --progress-bar -L -C - -O https://downloads.videolan.org/vlc/${1}/vlc-${1}.tar.xz
step "Unpack ..."
/usr/bin/tar -xf vlc-${1}.tar.xz
}
install_sparkle() {
hr "Setting up dependency Sparkle v${1} (might prompt for password)"
ensure_dir "${DEPS_BUILD_DIR}/sparkle"
step "Download..."
${CURLCMD} --progress-bar -L -C - -o sparkle.tar.bz2 https://github.com/sparkle-project/Sparkle/releases/download/${1}/Sparkle-${1}.tar.bz2
step "Unpack..."
/usr/bin/tar -xf ./sparkle.tar.bz2
step "Copy to destination..."
if [ -d /Library/Frameworks/Sparkle.framework/ ]; then
info "Warning - Sparkle framework already found in /Library/Frameworks"
else
sudo /bin/cp -R ./Sparkle.framework/ /Library/Frameworks/Sparkle.framework/
fi
}
install_cef() {
hr "Building dependency CEF v${1}"
ensure_dir "${DEPS_BUILD_DIR}"
step "Download..."
${CURLCMD} --progress-bar -L -C - -O https://cdn-fastly.obsproject.com/downloads/cef_binary_${1}_macos_x86_64.tar.xz
step "Unpack..."
/usr/bin/tar -xf ./cef_binary_${1}_macos_x86_64.tar.xz
cd ./cef_binary_${1}_macos_x86_64
step "Fix tests..."
/usr/bin/sed -i '.orig' '/add_subdirectory(tests\/ceftests)/d' ./CMakeLists.txt
/usr/bin/sed -i '.orig' 's/"'$(test "${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}}" -le 3770 && echo "10.9" || echo "10.10")'"/"'${MIN_MACOS_VERSION:-${CI_MIN_MACOS_VERSION}}'"/' ./cmake/cef_variables.cmake
ensure_dir ./build
step "Run CMAKE..."
cmake \
-DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++ -Wno-deprecated-declarations"\
-DCMAKE_EXE_LINKER_FLAGS="-std=c++11 -stdlib=libc++"\
-DCMAKE_OSX_DEPLOYMENT_TARGET=${MIN_MACOS_VERSION:-${CI_MIN_MACOS_VERSION}} \
..
step "Build..."
/usr/bin/make -j${NPROC}
if [ ! -d libcef_dll ]; then /bin/mkdir libcef_dll; fi
}
## CHECK AND INSTALL PACKAGING DEPENDENCIES ##
install_dmgbuild() {
if ! exists dmgbuild; then
if exists "pip3"; then
PIPCMD="pip3"
elif exists "pip"; then
PIPCMD="pip"
else
error "Pip not found - please install pip via 'python -m ensurepip'"
exit 1
fi
${PIPCMD} install dmgbuild
fi
}
## OBS BUILD FROM SOURCE ##
configure_obs_build() {
ensure_dir "${CHECKOUT_DIR}/${BUILD_DIR}"
CUR_DATE=$(/bin/date +"%Y-%m-%d@%H%M%S")
NIGHTLY_DIR="${CHECKOUT_DIR}/nightly-${CUR_DATE}"
PACKAGE_NAME=$(/usr/bin/find . -name "*.dmg")
if [ -d ./OBS.app ]; then
ensure_dir "${NIGHTLY_DIR}"
/bin/mv "../${BUILD_DIR}/OBS.app" .
info "You can find OBS.app in ${NIGHTLY_DIR}"
fi
ensure_dir "${CHECKOUT_DIR}/${BUILD_DIR}"
if ([ -n "${PACKAGE_NAME}" ] && [ -f ${PACKAGE_NAME} ]); then
ensure_dir "${NIGHTLY_DIR}"
/bin/mv "../${BUILD_DIR}/$(basename "${PACKAGE_NAME}")" .
info "You can find ${PACKAGE_NAME} in ${NIGHTLY_DIR}"
fi
ensure_dir "${CHECKOUT_DIR}/${BUILD_DIR}"
hr "Run CMAKE for OBS..."
cmake -DENABLE_SPARKLE_UPDATER=ON \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${MIN_MACOS_VERSION:-${CI_MIN_MACOS_VERSION}} \
-DQTDIR="/tmp/obsdeps" \
-DSWIGDIR="/tmp/obsdeps" \
-DDepsPath="/tmp/obsdeps" \
-DVLCPath="${DEPS_BUILD_DIR}/vlc-${VLC_VERSION:-${CI_VLC_VERSION}}" \
-DBUILD_BROWSER=ON \
-DBROWSER_LEGACY="$(test "${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}}" -le 3770 && echo "ON" || echo "OFF")" \
-DWITH_RTMPS=ON \
-DCEF_ROOT_DIR="${DEPS_BUILD_DIR}/cef_binary_${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}}_macos_x86_64" \
-DCMAKE_BUILD_TYPE="${BUILD_CONFIG}" \
..
}
run_obs_build() {
ensure_dir "${CHECKOUT_DIR}/${BUILD_DIR}"
hr "Build OBS..."
/usr/bin/make -j${NPROC}
}
## OBS BUNDLE AS MACOS APPLICATION ##
bundle_dylibs() {
ensure_dir "${CHECKOUT_DIR}/${BUILD_DIR}"
if [ ! -d ./OBS.app ]; then
error "No OBS.app bundle found"
exit 1
fi
hr "Bundle dylibs for macOS application"
step "Run dylibBundler.."
BUNDLE_PLUGINS=(
./OBS.app/Contents/PlugIns/coreaudio-encoder.so
./OBS.app/Contents/PlugIns/decklink-ouput-ui.so
./OBS.app/Contents/PlugIns/decklink-captions.so
./OBS.app/Contents/PlugIns/frontend-tools.so
./OBS.app/Contents/PlugIns/image-source.so
./OBS.app/Contents/PlugIns/mac-avcapture.so
./OBS.app/Contents/PlugIns/mac-capture.so
./OBS.app/Contents/PlugIns/mac-decklink.so
./OBS.app/Contents/PlugIns/mac-syphon.so
./OBS.app/Contents/PlugIns/mac-vth264.so
./OBS.app/Contents/PlugIns/mac-virtualcam.so
./OBS.app/Contents/PlugIns/obs-browser.so
./OBS.app/Contents/PlugIns/obs-ffmpeg.so
./OBS.app/Contents/PlugIns/obs-filters.so
./OBS.app/Contents/PlugIns/obs-transitions.so
./OBS.app/Contents/PlugIns/obs-vst.so
./OBS.app/Contents/PlugIns/rtmp-services.so
./OBS.app/Contents/MacOS/obs-ffmpeg-mux
./OBS.app/Contents/MacOS/obslua.so
./OBS.app/Contents/MacOS/_obspython.so
./OBS.app/Contents/PlugIns/obs-x264.so
./OBS.app/Contents/PlugIns/text-freetype2.so
./OBS.app/Contents/PlugIns/obs-outputs.so
./OBS.app/Contents/PlugIns/aja.so
./OBS.app/Contents/PlugIns/aja-output-ui.so
)
SEARCH_PATHS=(
/tmp/obsdeps/lib
/tmp/obsdeps/lib/QtSvg.framework
/tmp/obsdeps/lib/QtXml.framework
/tmp/obsdeps/lib/QtNetwork.framework
/tmp/obsdeps/lib/QtCore.framework
/tmp/obsdeps/lib/QtGui.framework
/tmp/obsdeps/lib/QtWidgets.framework
/tmp/obsdeps/lib/QtDBus.framework
/tmp/obsdeps/lib/QtPrintSupport.framework
)
if ! [ "${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}}" -le 3770 ]; then
"${CI_SCRIPTS}/app/dylibbundler" -cd -of -a ./OBS.app -q -f \
-s ./OBS.app/Contents/MacOS \
-s "${DEPS_BUILD_DIR}/sparkle/Sparkle.framework" \
-s ./rundir/${BUILD_CONFIG}/bin/ \
$(echo "${SEARCH_PATHS[@]/#/-s }") \
$(echo "${BUNDLE_PLUGINS[@]/#/-x }")
else
"${CI_SCRIPTS}/app/dylibbundler" -cd -of -a ./OBS.app -q -f \
-s ./OBS.app/Contents/MacOS \
-s "${DEPS_BUILD_DIR}/sparkle/Sparkle.framework" \
-s ./rundir/${BUILD_CONFIG}/bin/ \
$(echo "${SEARCH_PATHS[@]/#/-s }") \
$(echo "${BUNDLE_PLUGINS[@]/#/-x }") \
-x ./OBS.app/Contents/PlugIns/obs-browser-page
fi
step "Move libobs-opengl to final destination"
if [ -f "./libobs-opengl/libobs-opengl.so" ]; then
/bin/cp ./libobs-opengl/libobs-opengl.so ./OBS.app/Contents/Frameworks
else
/bin/cp ./libobs-opengl/${BUILD_CONFIG}/libobs-opengl.so ./OBS.app/Contents/Frameworks
fi
}
install_frameworks() {
ensure_dir "${CHECKOUT_DIR}/${BUILD_DIR}"
if [ ! -d ./OBS.app ]; then
error "No OBS.app bundle found"
exit 1
fi
hr "Adding Chromium Embedded Framework"
step "Copy Framework..."
/bin/cp -R "${DEPS_BUILD_DIR}/cef_binary_${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}}_macos_x86_64/Release/Chromium Embedded Framework.framework" ./OBS.app/Contents/Frameworks/
}
prepare_macos_bundle() {
ensure_dir "${CHECKOUT_DIR}/${BUILD_DIR}"
if [ ! -d ./rundir/${BUILD_CONFIG}/bin ]; then
error "No OBS build found"
return
fi
if [ -d ./OBS.app ]; then /bin/rm -rf ./OBS.app; fi
hr "Preparing OBS.app bundle"
step "Copy binary and plugins..."
/bin/mkdir -p OBS.app/Contents/MacOS
/bin/mkdir OBS.app/Contents/PlugIns
/bin/mkdir OBS.app/Contents/Resources
/bin/mkdir OBS.app/Contents/Frameworks
/bin/cp rundir/${BUILD_CONFIG}/bin/obs ./OBS.app/Contents/MacOS
/bin/cp rundir/${BUILD_CONFIG}/bin/obs-ffmpeg-mux ./OBS.app/Contents/MacOS
/bin/cp rundir/${BUILD_CONFIG}/bin/libobsglad.0.dylib ./OBS.app/Contents/MacOS
if ! [ "${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}}" -le 3770 ]; then
/bin/cp -R "rundir/${BUILD_CONFIG}/bin/OBS Helper.app" "./OBS.app/Contents/Frameworks/OBS Helper.app"
/bin/cp -R "rundir/${BUILD_CONFIG}/bin/OBS Helper (GPU).app" "./OBS.app/Contents/Frameworks/OBS Helper (GPU).app"
/bin/cp -R "rundir/${BUILD_CONFIG}/bin/OBS Helper (Plugin).app" "./OBS.app/Contents/Frameworks/OBS Helper (Plugin).app"
/bin/cp -R "rundir/${BUILD_CONFIG}/bin/OBS Helper (Renderer).app" "./OBS.app/Contents/Frameworks/OBS Helper (Renderer).app"
fi
/bin/cp -R rundir/${BUILD_CONFIG}/data ./OBS.app/Contents/Resources
/bin/cp "${CI_SCRIPTS}/app/AppIcon.icns" ./OBS.app/Contents/Resources
/bin/cp -R rundir/${BUILD_CONFIG}/obs-plugins/ ./OBS.app/Contents/PlugIns
/bin/cp "${CI_SCRIPTS}/app/Info.plist" ./OBS.app/Contents
# Scripting plugins are required to be placed in same directory as binary
if [ -d ./OBS.app/Contents/Resources/data/obs-scripting ]; then
/bin/mv ./OBS.app/Contents/Resources/data/obs-scripting/obslua.so ./OBS.app/Contents/MacOS/
/bin/mv ./OBS.app/Contents/Resources/data/obs-scripting/_obspython.so ./OBS.app/Contents/MacOS/
/bin/mv ./OBS.app/Contents/Resources/data/obs-scripting/obspython.py ./OBS.app/Contents/MacOS/
/bin/rm -rf ./OBS.app/Contents/Resources/data/obs-scripting/
fi
# dylibbundler will only copy actually linked files into bundle, but not symlinks
/bin/cp -cpR /tmp/obsdeps/lib/*.dylib ./OBS.app/Contents/Frameworks
bundle_dylibs
install_frameworks
/bin/cp "${CI_SCRIPTS}/app/OBSPublicDSAKey.pem" ./OBS.app/Contents/Resources
step "Set bundle meta information..."
/usr/bin/plutil -insert CFBundleVersion -string ${GIT_TAG}-${GIT_HASH} ./OBS.app/Contents/Info.plist
/usr/bin/plutil -insert CFBundleShortVersionString -string ${GIT_TAG}-${GIT_HASH} ./OBS.app/Contents/Info.plist
/usr/bin/plutil -insert OBSFeedsURL -string https://obsproject.com/osx_update/feeds.xml ./OBS.app/Contents/Info.plist
/usr/bin/plutil -insert SUFeedURL -string https://obsproject.com/osx_update/stable/updates.xml ./OBS.app/Contents/Info.plist
/usr/bin/plutil -insert SUPublicDSAKeyFile -string OBSPublicDSAKey.pem ./OBS.app/Contents/Info.plist
}
## CREATE MACOS DISTRIBUTION AND INSTALLER IMAGE ##
prepare_macos_image() {
ensure_dir "${CHECKOUT_DIR}/${BUILD_DIR}"
if [ ! -d ./OBS.app ]; then
error "No OBS.app bundle found"
return
fi
hr "Preparing macOS installation image"
if [ -f "${FILE_NAME}" ]; then
/bin/rm "${FILE_NAME}"
fi
step "Run dmgbuild..."
/bin/cp "${CI_SCRIPTS}/package/settings.json.template" ./settings.json
/usr/bin/sed -i '' 's#\$\$VERSION\$\$#'"${GIT_TAG}"'#g' ./settings.json
/usr/bin/sed -i '' 's#\$\$CI_PATH\$\$#'"${CI_SCRIPTS}"'#g' ./settings.json
/usr/bin/sed -i '' 's#\$\$BUNDLE_PATH\$\$#'"${CHECKOUT_DIR}"'/build#g' ./settings.json
/bin/echo -n "${COLOR_ORANGE}"
dmgbuild "OBS-Studio ${GIT_TAG}" "${FILE_NAME}" -s ./settings.json
/bin/echo -n "${COLOR_RESET}"
if [ -n "${CODESIGN_OBS}" ]; then
codesign_image
fi
}
## SET UP CODE SIGNING AND NOTARIZATION CREDENTIALS ##
##############################################################################
# Apple Developer Identity needed:
#
# + Signing the code requires a developer identity in the system's keychain
# + codesign will look up and find the identity automatically
#
##############################################################################
read_codesign_ident() {
if [ ! -n "${CODESIGN_IDENT}" ]; then
step "Code-signing Setup"
/usr/bin/read -p "${COLOR_ORANGE} + Apple developer identity: ${COLOR_RESET}" CODESIGN_IDENT
fi
}
##############################################################################
# Apple Developer credentials necessary:
#
# + Signing for distribution and notarization require an active Apple
# Developer membership
# + An Apple Development identity is needed for code signing
# (i.e. 'Apple Development: YOUR APPLE ID (PROVIDER)')
# + Your Apple developer ID is needed for notarization
# + An app-specific password is necessary for notarization from CLI
# + This password will be stored in your macOS keychain under the identifier
# 'OBS-Codesign-Password'with access Apple's 'altool' only.
##############################################################################
read_codesign_pass() {
if [ ! -n "${CODESIGN_IDENT_PASS}" ]; then
step "Notarization Setup"
/usr/bin/read -p "${COLOR_ORANGE} + Apple account id: ${COLOR_RESET}" CODESIGN_IDENT_USER
CODESIGN_IDENT_PASS=$(stty -echo; /usr/bin/read -p "${COLOR_ORANGE} + Apple developer password: ${COLOR_RESET}" pwd; stty echo; /bin/echo $pwd)
/bin/echo -n "${COLOR_ORANGE}"
/usr/bin/xcrun altool --store-password-in-keychain-item "OBS-Codesign-Password" -u "${CODESIGN_IDENT_USER}" -p "${CODESIGN_IDENT_PASS}"
/bin/echo -n "${COLOR_RESET}"
CODESIGN_IDENT_SHORT=$(/bin/echo "${CODESIGN_IDENT}" | /usr/bin/sed -En "s/.+\((.+)\)/\1/p")
fi
}
codesign_bundle() {
if [ ! -n "${CODESIGN_OBS}" ]; then step "Skipping application bundle code signing"; return; fi
ensure_dir "${CHECKOUT_DIR}/${BUILD_DIR}"
trap "caught_error 'code-signing app'" ERR
if [ ! -d ./OBS.app ]; then
error "No OBS.app bundle found"
return
fi
hr "Code-signing application bundle"
/usr/bin/xattr -crs ./OBS.app
read_codesign_ident
step "Code-sign Sparkle framework..."
/bin/echo -n "${COLOR_ORANGE}"
/usr/bin/codesign --force --options runtime --sign "${CODESIGN_IDENT}" "./OBS.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/fileop"
/usr/bin/codesign --force --options runtime --sign "${CODESIGN_IDENT}" "./OBS.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/Autoupdate"
/usr/bin/codesign --force --options runtime --sign "${CODESIGN_IDENT}" --deep ./OBS.app/Contents/Frameworks/Sparkle.framework
/bin/echo -n "${COLOR_RESET}"
step "Code-sign CEF framework..."
/bin/echo -n "${COLOR_ORANGE}"
/usr/bin/codesign --force --options runtime --entitlements "${CI_SCRIPTS}/app/entitlements.plist" --sign "${CODESIGN_IDENT}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libEGL.dylib"
/usr/bin/codesign --force --options runtime --entitlements "${CI_SCRIPTS}/app/entitlements.plist" --sign "${CODESIGN_IDENT}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libswiftshader_libEGL.dylib"
/usr/bin/codesign --force --options runtime --entitlements "${CI_SCRIPTS}/app/entitlements.plist" --sign "${CODESIGN_IDENT}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib"
/usr/bin/codesign --force --options runtime --entitlements "${CI_SCRIPTS}/app/entitlements.plist" --sign "${CODESIGN_IDENT}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libswiftshader_libGLESv2.dylib"
if ! [ "${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}}" -le 3770 ]; then
/usr/bin/codesign --force --options runtime --entitlements "${CI_SCRIPTS}/app/entitlements.plist" --sign "${CODESIGN_IDENT}" "./OBS.app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/libvk_swiftshader.dylib"
fi
/bin/echo -n "${COLOR_RESET}"
if ! [ "${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}}" -le 3770 ]; then
step "Code-sign CEF helper apps..."
/bin/echo -n "${COLOR_ORANGE}"
/usr/bin/codesign --force --options runtime --entitlements "${CI_SCRIPTS}/helpers/helper-entitlements.plist" --sign "${CODESIGN_IDENT}" --deep "./OBS.app/Contents/Frameworks/OBS Helper.app"
/usr/bin/codesign --force --options runtime --entitlements "${CI_SCRIPTS}/helpers/helper-gpu-entitlements.plist" --sign "${CODESIGN_IDENT}" --deep "./OBS.app/Contents/Frameworks/OBS Helper (GPU).app"
/usr/bin/codesign --force --options runtime --entitlements "${CI_SCRIPTS}/helpers/helper-plugin-entitlements.plist" --sign "${CODESIGN_IDENT}" --deep "./OBS.app/Contents/Frameworks/OBS Helper (Plugin).app"
/usr/bin/codesign --force --options runtime --entitlements "${CI_SCRIPTS}/helpers/helper-renderer-entitlements.plist" --sign "${CODESIGN_IDENT}" --deep "./OBS.app/Contents/Frameworks/OBS Helper (Renderer).app"
/bin/echo -n "${COLOR_RESET}"
fi
step "Code-sign DAL Plugin..."
/bin/echo -n "${COLOR_ORANGE}"
/usr/bin/codesign --force --options runtime --deep --sign "${CODESIGN_IDENT}" "./OBS.app/Contents/Resources/data/obs-plugins/mac-virtualcam/obs-mac-virtualcam.plugin"
/bin/echo -n "${COLOR_RESET}"
step "Code-sign OBS code..."
/bin/echo -n "${COLOR_ORANGE}"
/usr/bin/codesign --force --options runtime --entitlements "${CI_SCRIPTS}/app/entitlements.plist" --sign "${CODESIGN_IDENT}" --deep ./OBS.app
/bin/echo -n "${COLOR_RESET}"
step "Check code-sign result..."
/usr/bin/codesign -dvv ./OBS.app
}
codesign_image() {
if [ ! -n "${CODESIGN_OBS}" ]; then step "Skipping installer image code signing"; return; fi
ensure_dir "${CHECKOUT_DIR}/${BUILD_DIR}"
trap "caught_error 'code-signing image'" ERR
if [ ! -f "${FILE_NAME}" ]; then
error "No OBS disk image found"
return
fi
hr "Code-signing installation image"
read_codesign_ident
step "Code-sign OBS installer image..."
/bin/echo -n "${COLOR_ORANGE}";
/usr/bin/codesign --force --sign "${CODESIGN_IDENT}" "${FILE_NAME}"
/bin/echo -n "${COLOR_RESET}"
step "Check code-sign result..."
/usr/bin/codesign -dvv "${FILE_NAME}"
}
## BUILD FROM SOURCE META FUNCTION ##
full-build-macos() {
if [ -n "${SKIP_BUILD}" ]; then step "Skipping full build"; return; fi
if [ ! -n "${SKIP_DEPS}" ]; then
hr "Installing Homebrew dependencies"
install_homebrew_deps
for DEPENDENCY in "${BUILD_DEPS[@]}"; do
set -- ${DEPENDENCY}
trap "caught_error ${DEPENDENCY}" ERR
FUNC_NAME="install_${1}"
${FUNC_NAME} ${2} ${3}
done
check_ccache
trap "caught_error 'cmake'" ERR
fi
configure_obs_build
run_obs_build
}
## BUNDLE MACOS APPLICATION META FUNCTION ##
bundle_macos() {
if [ ! -n "${BUNDLE_OBS}" ]; then step "Skipping application bundle creation"; return; fi
hr "Creating macOS app bundle"
trap "caught_error 'bundle app'" ERR
ensure_dir ${CHECKOUT_DIR}
prepare_macos_bundle
}
## PACKAGE MACOS DISTRIBUTION IMAGE META FUNCTION ##
package_macos() {
if [ ! -n "${PACKAGE_OBS}" ]; then step "Skipping installer image creation"; return; fi
hr "Creating macOS .dmg image"
trap "caught_error 'package app'" ERR
install_dmgbuild
prepare_macos_image
}
## NOTARIZATION META FUNCTION ##
notarize_macos() {
if [ ! -n "${NOTARIZE_OBS}" ]; then step "Skipping macOS notarization"; return; fi;
hr "Notarizing OBS for macOS"
trap "caught_error 'notarizing app'" ERR
ensure_dir "${CHECKOUT_DIR}/${BUILD_DIR}"
if [ -f "${FILE_NAME}" ]; then
NOTARIZE_TARGET="${FILE_NAME}"
xcnotary precheck "./OBS.app"
elif [ -d "OBS.app" ]; then
NOTARIZE_TARGET="./OBS.app"
else
error "No notarization app bundle ('OBS.app') or disk image ('${FILE_NAME}') found"
return
fi
if [ "$?" -eq 0 ]; then
read_codesign_ident
read_codesign_pass
step "Run xcnotary with ${NOTARIZE_TARGET}..."
xcnotary notarize "${NOTARIZE_TARGET}" --developer-account "${CODESIGN_IDENT_USER}" --developer-password-keychain-item "OBS-Codesign-Password" --provider "${CODESIGN_IDENT_SHORT}"
fi
}
## MAIN SCRIPT FUNCTIONS ##
print_usage() {
/bin/echo "full-build-macos.sh - Build helper script for OBS-Studio\n"
/bin/echo "Usage: ${0}\n" \
"-d: Skip dependency checks\n" \
"-b: Create macOS app bundle\n" \
"-c: Codesign macOS app bundle\n" \
"-p: Package macOS app into disk image\n" \
"-n: Notarize macOS app and disk image (implies -b)\n" \
"-s: Skip build process (useful for bundling/packaging only)\n" \
"-h: Print this help"
exit 0
}
obs-build-main() {
ensure_dir ${CHECKOUT_DIR}
check_macos_version
step "Fetching OBS tags..."
/usr/bin/git fetch origin --tags
GIT_BRANCH=$(/usr/bin/git rev-parse --abbrev-ref HEAD)
GIT_HASH=$(/usr/bin/git rev-parse --short HEAD)
GIT_TAG=$(/usr/bin/git describe --tags --abbrev=0)
FILE_NAME="obs-studio-${GIT_TAG}-${GIT_HASH}-macOS.dmg"
##########################################################################
# IMPORTANT:
#
# Be careful when choosing to notarize and code-sign. The script will try
# to sign any pre-existing bundle but also pre-existing images.
#
# This could lead to a package containing a non-signed bundle, which
# will then fail notarization.
#
# To avoid this, run this script with -b -c first, then -p -c or -p -n
# after to make sure that a code-signed bundle will be packaged.
#
##########################################################################
while getopts ":hdsbnpc" OPTION; do
case ${OPTION} in
h) print_usage ;;
d) SKIP_DEPS=1 ;;
s) SKIP_BUILD=1 ;;
b) BUNDLE_OBS=1 ;;
n) CODESIGN_OBS=1; NOTARIZE_OBS=1 ;;
p) PACKAGE_OBS=1 ;;
c) CODESIGN_OBS=1 ;;
\?) ;;
esac
done
full-build-macos
bundle_macos
codesign_bundle
package_macos
codesign_image
notarize_macos
cleanup
}
obs-build-main $*

7
CI/include/Brewfile Normal file
View File

@ -0,0 +1,7 @@
brew "cmake"
brew "ccache"
brew "ninja"
brew "freetype"
brew "cmocka"
brew "swig"
brew "coreutils"

2
CI/include/Wingetfile Normal file
View File

@ -0,0 +1,2 @@
package '7zip.7zip', path: '7-zip', bin: '7z'
package 'cmake', path: 'Cmake\bin', bin: 'cmake'

217
CI/include/build_support.sh Normal file
View File

@ -0,0 +1,217 @@
#!/bin/bash
##############################################################################
# Unix support functions
##############################################################################
#
# This script file can be included in build scripts for UNIX-compatible
# shells to compose build scripts.
#
##############################################################################
## DEFINE UTILITIES ##
if [ -z "${QUIET}" ]; then
status() {
echo -e "${COLOR_BLUE}[${PRODUCT_NAME}] ${1}${COLOR_RESET}"
}
step() {
echo -e "${COLOR_GREEN} + ${1}${COLOR_RESET}"
}
info() {
echo -e "${COLOR_ORANGE} + ${1}${COLOR_RESET}"
}
error() {
echo -e "${COLOR_RED} + ${1}${COLOR_RESET}"
}
else
status() {
:
}
step() {
:
}
info() {
:
}
error() {
echo -e "${COLOR_RED} + ${1}${COLOR_RESET}"
}
fi
exists() {
/usr/bin/command -v "$1" >/dev/null 2>&1
}
ensure_dir() {
[ -n "${1}" ] && /bin/mkdir -p "${1}" && builtin cd "${1}"
}
cleanup() {
:
}
caught_error() {
error "ERROR during build step: ${1}"
cleanup
exit 1
}
# Setup build environment
BUILD_DIR="${BUILD_DIR:-build}"
BUILD_CONFIG="${BUILD_CONFIG:-RelWithDebInfo}"
CI_WORKFLOW="${CHECKOUT_DIR}/.github/workflows/main.yml"
CURRENT_ARCH="$(uname -m)"
CURRENT_DATE="$(date +"%Y-%m-%d")"
## Utility functions ##
check_ccache() {
step "Check CCache..."
if ccache -V >/dev/null 2>&1; then
info "CCache available"
CMAKE_CCACHE_OPTIONS="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache"
if [ "${CI}" ]; then
ccache --set-config=cache_dir=${GITHUB_WORKSPACE:-${HOME}}/.ccache
ccache --set-config=max_size=${CCACHE_SIZE:-500M}
ccache --set-config=compression=true
ccache -z
fi
else
info "CCache not available"
fi
}
safe_fetch() {
if [ $# -lt 2 ]; then
error "Usage: safe_fetch URL HASH"
return 1
fi
while true; do
case "${1}" in
-n | --nocontinue ) NOCONTINUE=TRUE; shift ;;
-- ) shift; break ;;
* ) break ;;
esac
done
DOWNLOAD_URL="${1}"
DOWNLOAD_HASH="${2}"
DOWNLOAD_FILE="$(basename ${DOWNLOAD_URL})"
CURLCMD=${CURLCMD:-curl}
if [ "${NOCONTINUE}" ]; then
${CURLCMD/--continue-at -/} "${DOWNLOAD_URL}"
else
${CURLCMD} "${DOWNLOAD_URL}"
fi
if [ "${DOWNLOAD_HASH}" = "$(sha256sum "${DOWNLOAD_FILE}" | cut -d " " -f 1)" ]; then
info "${DOWNLOAD_FILE} downloaded successfully and passed hash check"
return 0
else
error "${DOWNLOAD_FILE} downloaded successfully and failed hash check"
return 1
fi
}
check_and_fetch() {
if [ $# -lt 2 ]; then
caught_error "Usage: check_and_fetch URL HASH"
fi
while true; do
case "${1}" in
-n | --nocontinue ) NOCONTINUE=TRUE; shift ;;
-- ) shift; break ;;
* ) break ;;
esac
done
DOWNLOAD_URL="${1}"
DOWNLOAD_HASH="${2}"
DOWNLOAD_FILE="$(basename "${DOWNLOAD_URL}")"
if [ -f "${DOWNLOAD_FILE}" ] && [ "${DOWNLOAD_HASH}" = "$(sha256sum "${DOWNLOAD_FILE}" | cut -d " " -f 1)" ]; then
info "${DOWNLOAD_FILE} exists and passed hash check"
return 0
else
safe_fetch "${DOWNLOAD_URL}" "${DOWNLOAD_HASH}"
fi
}
github_fetch() {
if [ $# -ne 3 ]; then
error "Usage: github_fetch GITHUB_USER GITHUB_REPOSITORY GITHUB_COMMIT_HASH"
return 1
fi
GH_USER="${1}"
GH_REPO="${2}"
GH_REF="${3}"
if [ -d "./.git" ]; then
info "Repository ${GH_USER}/${GH_REPO} already exists, updating..."
git config advice.detachedHead false
git config remote.origin.url "https://github.com/${GH_USER}/${GH_REPO}.git"
git config remote.origin.fetch "+refs/heads/master:refs/remotes/origin/master"
git config remote.origin.tapOpt --no-tags
if ! git rev-parse -q --verify "${GH_COMMIT}^{commit}"; then
git fetch origin
fi
git checkout -f "${GH_REF}" --
git reset --hard "${GH_REF}" --
if [ -d "./.gitmodules" ]; then
git submodule foreach --recursive git submodule sync
git submodule update --init --recursive
fi
else
git clone "https://github.com/${GH_USER}/${GH_REPO}.git" "$(pwd)"
git config advice.detachedHead false
info "Checking out commit ${GH_REF}..."
git checkout -f "${GH_REF}" --
if [ -d "./.gitmodules" ]; then
git submodule foreach --recursive git submodule sync
git submodule update --init --recursive
fi
fi
}
apply_patch() {
if [ $# -ne 2 ]; then
error "Usage: apply_patch PATCH_URL PATCH_HASH"
return 1
fi
COMMIT_URL="${1}"
COMMIT_HASH="${2}"
PATCH_FILE="$(basename ${COMMIT_URL})"
if [ "${COMMIT_URL:0:5}" = "https" ]; then
${CURLCMD:-curl} "${COMMIT_URL}"
if [ "${COMMIT_HASH}" = "$(sha256sum ${PATCH_FILE} | cut -d " " -f 1)" ]; then
info "${PATCH_FILE} downloaded successfully and passed hash check"
else
error "${PATCH_FILE} downloaded successfully and failed hash check"
return 1
fi
info "Applying patch ${COMMIT_URL}"
else
PATCH_FILE="${COMMIT_URL}"
fi
patch -g 0 -f -p1 -i "${PATCH_FILE}"
}

View File

@ -0,0 +1,42 @@
#!/usr/bin/env bash
##############################################################################
# FreeBSD support functions
##############################################################################
#
# This script file can be included in build scripts for FreeBSD.
#
##############################################################################
# Setup build environment
if [ "${TERM-}" -a -x /usr/local/bin/tput ]; then
COLOR_RED=$(/usr/local/bin/tput setaf 1)
COLOR_GREEN=$(/usr/local/bin/tput setaf 2)
COLOR_BLUE=$(/usr/local/bin/tput setaf 4)
COLOR_ORANGE=$(/usr/local/bin/tput setaf 3)
COLOR_RESET=$(/usr/local/bin/tput sgr0)
else
COLOR_RED=""
COLOR_GREEN=""
COLOR_BLUE=""
COLOR_ORANGE=""
COLOR_RESET=""
fi
if [ "${CI}" -o "${QUIET}" ]; then
export CURLCMD="curl --silent --show-error --location -O"
else
export CURLCMD="curl --progress-bar --location --continue-at - -O"
fi
_add_ccache_to_path() {
if [ "${CMAKE_CCACHE_OPTIONS}" ]; then
PATH="/usr/local/opt/ccache/libexec:${PATH}"
status "Compiler Info:"
local IFS=$'\n'
for COMPILER_INFO in $(type cc c++ gcc g++ clang clang++ || true); do
info "${COMPILER_INFO}"
done
fi
}

View File

@ -0,0 +1,44 @@
#!/bin/bash
##############################################################################
# Linux support functions
##############################################################################
#
# This script file can be included in build scripts for Linux.
#
##############################################################################
# Setup build environment
CI_LINUX_CEF_VERSION=$(cat "${CI_WORKFLOW}" | sed -En "s/[ ]+CEF_BUILD_VERSION_LINUX: '([0-9]+)'/\1/p")
if [ "${TERM-}" -a -z "${CI}" ]; then
COLOR_RED=$(tput setaf 1)
COLOR_GREEN=$(tput setaf 2)
COLOR_BLUE=$(tput setaf 4)
COLOR_ORANGE=$(tput setaf 3)
COLOR_RESET=$(tput sgr0)
else
COLOR_RED=""
COLOR_GREEN=""
COLOR_BLUE=""
COLOR_ORANGE=""
COLOR_RESET=""
fi
if [ "${CI}" -o "${QUIET}" ]; then
export CURLCMD="curl --silent --show-error --location -O"
else
export CURLCMD="curl --progress-bar --location --continue-at - -O"
fi
_add_ccache_to_path() {
if [ "${CMAKE_CCACHE_OPTIONS}" ]; then
PATH="/usr/local/opt/ccache/libexec:${PATH}"
status "Compiler Info:"
local IFS=$'\n'
for COMPILER_INFO in $(type cc c++ gcc g++ clang clang++ || true); do
info "${COMPILER_INFO}"
done
fi
}

View File

@ -0,0 +1,180 @@
#!/bin/bash
##############################################################################
# macOS support functions
##############################################################################
#
# This script file can be included in build scripts for macOS.
#
##############################################################################
# Setup build environment
WORKFLOW_CONTENT=$(/bin/cat "${CI_WORKFLOW}")
CI_DEPS_VERSION=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+DEPS_VERSION_MAC: '([0-9\-]+)'/\1/p")
CI_DEPS_HASH_X86_64=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+DEPS_HASH_MAC_X86_64: '([0-9a-f]+)'/\1/p")
CI_DEPS_HASH_ARM64=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+DEPS_HASH_MAC_ARM64: '([0-9a-f]+)'/\1/p")
CI_VLC_VERSION=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+VLC_VERSION_MAC: '([0-9\.]+)'/\1/p")
CI_VLC_HASH=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+VLC_HASH_MAC: '([0-9a-f]+)'/\1/p")
CI_SPARKLE_VERSION=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+SPARKLE_VERSION: '([0-9\.]+)'/\1/p")
CI_SPARKLE_HASH=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+SPARKLE_HASH: '([0-9a-f]+)'/\1/p")
CI_QT_VERSION=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+QT_VERSION_MAC: '([0-9\.]+)'/\1/p" | /usr/bin/head -1)
CI_QT_HASH_X86_64=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+QT_HASH_MAC_X86_64: '([0-9a-f]+)'/\1/p")
CI_QT_HASH_ARM64=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+QT_HASH_MAC_ARM64: '([0-9a-f]+)'/\1/p")
CI_MACOSX_DEPLOYMENT_TARGET_X86_64=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+MACOSX_DEPLOYMENT_TARGET_X86_64: '([0-9\.]+)'/\1/p")
CI_MACOSX_DEPLOYMENT_TARGET_ARM64=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+MACOSX_DEPLOYMENT_TARGET_ARM64: '([0-9\.]+)'/\1/p")
CI_MACOS_CEF_VERSION=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+CEF_BUILD_VERSION_MAC: '([0-9]+)'/\1/p")
CI_CEF_HASH_X86_64=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+CEF_HASH_MAC_X86_64: '([0-9a-f]+)'/\1/p")
CI_CEF_HASH_ARM64=$(echo "${WORKFLOW_CONTENT}" | /usr/bin/sed -En "s/[ ]+CEF_HASH_MAC_ARM64: '([0-9a-f]+)'/\1/p")
MACOS_VERSION="$(/usr/bin/sw_vers -productVersion)"
MACOS_MAJOR="$(echo ${MACOS_VERSION} | /usr/bin/cut -d '.' -f 1)"
MACOS_MINOR="$(echo ${MACOS_VERSION} | /usr/bin/cut -d '.' -f 2)"
if [ "${TERM-}" -a -z "${CI}" ]; then
COLOR_RED=$(/usr/bin/tput setaf 1)
COLOR_GREEN=$(/usr/bin/tput setaf 2)
COLOR_BLUE=$(/usr/bin/tput setaf 4)
COLOR_ORANGE=$(/usr/bin/tput setaf 3)
COLOR_RESET=$(/usr/bin/tput sgr0)
else
COLOR_RED=""
COLOR_GREEN=""
COLOR_BLUE=""
COLOR_ORANGE=""
COLOR_RESET=""
fi
## DEFINE UTILITIES ##
check_macos_version() {
ARCH="${ARCH:-${CURRENT_ARCH}}"
if [ "${ARCH}" = "x86_64" ]; then
CI_MACOSX_DEPLOYMENT_TARGET="${CI_MACOSX_DEPLOYMENT_TARGET_X86_64}"
CI_CEF_HASH="${CI_CEF_HASH_X86_64}"
CI_QT_HASH="${CI_QT_HASH_X86_64}"
CI_DEPS_HASH="${CI_DEPS_HASH_X86_64}"
elif [ "${ARCH}" = "arm64" ]; then
CI_MACOSX_DEPLOYMENT_TARGET="${CI_MACOSX_DEPLOYMENT_TARGET_ARM64}"
CI_CEF_HASH="${CI_CEF_HASH_ARM64}"
CI_QT_HASH="${CI_QT_HASH_ARM64}"
CI_DEPS_HASH="${CI_DEPS_HASH_ARM64}"
else
caught_error "Unsupported architecture '${ARCH}' provided"
fi
step "Check macOS version..."
MIN_VERSION=${MACOSX_DEPLOYMENT_TARGET:-${CI_MACOSX_DEPLOYMENT_TARGET}}
MIN_MAJOR=$(echo ${MIN_VERSION} | /usr/bin/cut -d '.' -f 1)
MIN_MINOR=$(echo ${MIN_VERSION} | /usr/bin/cut -d '.' -f 2)
if [ "${MACOS_MAJOR}" -lt "11" -a "${MACOS_MINOR}" -lt "${MIN_MINOR}" ]; then
error "ERROR: Minimum required macOS version is ${MIN_VERSION}, but running on ${MACOS_VERSION}"
fi
if [ "${MACOS_MAJOR}" -ge "11" ]; then
export CODESIGN_LINKER="ON"
fi
}
install_homebrew_deps() {
if ! exists brew; then
caught_error "Homebrew not found - please install Homebrew (https://brew.sh)"
fi
brew bundle --file "${CHECKOUT_DIR}/CI/include/Brewfile" ${QUIET:+--quiet}
check_curl
}
check_curl() {
if [ "${MACOS_MAJOR}" -lt "11" -a "${MACOS_MINOR}" -lt "15" ]; then
if [ ! -d /usr/local/opt/curl ]; then
step "Install Homebrew curl..."
brew install curl
fi
CURLCMD="/usr/local/opt/curl/bin/curl"
else
CURLCMD="curl"
fi
if [ "${CI}" -o "${QUIET}" ]; then
export CURLCMD="${CURLCMD} --silent --show-error --location -O"
else
export CURLCMD="${CURLCMD} --progress-bar --location --continue-at - -O"
fi
}
check_archs() {
step "Check Architecture..."
ARCH="${ARCH:-${CURRENT_ARCH}}"
if [ "${ARCH}" = "universal" ]; then
CMAKE_ARCHS="x86_64;arm64"
elif [ "${ARCH}" != "x86_64" -a "${ARCH}" != "arm64" ]; then
caught_error "Unsupported architecture '${ARCH}' provided"
else
CMAKE_ARCHS="${ARCH}"
fi
}
_add_ccache_to_path() {
if [ "${CMAKE_CCACHE_OPTIONS}" ]; then
if [ "${CURRENT_ARCH}" == "arm64" ]; then
PATH="/opt/homebrew/opt/ccache/libexec:${PATH}"
else
PATH="/usr/local/opt/ccache/libexec:${PATH}"
fi
status "Compiler Info:"
local IFS=$'\n'
for COMPILER_INFO in $(type cc c++ gcc g++ clang clang++ || true); do
info "${COMPILER_INFO}"
done
fi
}
## SET UP CODE SIGNING AND NOTARIZATION CREDENTIALS ##
##############################################################################
# Apple Developer Identity needed:
#
# + Signing the code requires a developer identity in the system's keychain
# + codesign will look up and find the identity automatically
#
##############################################################################
read_codesign_ident() {
if [ -z "${CODESIGN_IDENT}" ]; then
step "Set up code signing..."
read -p "${COLOR_ORANGE} + Apple developer identity: ${COLOR_RESET}" CODESIGN_IDENT
fi
}
##############################################################################
# Apple Developer credentials necessary:
#
# + Signing for distribution and notarization require an active Apple
# Developer membership
# + An Apple Development identity is needed for code signing
# (i.e. 'Apple Development: YOUR APPLE ID (PROVIDER)')
# + Your Apple developer ID is needed for notarization
# + An app-specific password is necessary for notarization from CLI
# + This password will be stored in your macOS keychain under the identifier
# 'OBS-Codesign-Password' with access Apple's 'altool' only.
##############################################################################
read_codesign_pass() {
step "Set up notarization..."
if [ -z "${CODESIGN_IDENT_USER}" ]; then
read -p "${COLOR_ORANGE} + Apple account id: ${COLOR_RESET}" CODESIGN_IDENT_USER
fi
if [ -z "${CODESIGN_IDENT_PASS}" ]; then
CODESIGN_IDENT_PASS=$(stty -echo; read -p "${COLOR_ORANGE} + Apple developer password: ${COLOR_RESET}" secret; stty echo; echo $secret)
echo ""
fi
step "Update notarization keychain..."
echo -n "${COLOR_ORANGE}"
/usr/bin/xcrun altool --store-password-in-keychain-item "OBS-Codesign-Password" -u "${CODESIGN_IDENT_USER}" -p "${CODESIGN_IDENT_PASS}"
echo -n "${COLOR_RESET}"
CODESIGN_IDENT_SHORT=$(echo "${CODESIGN_IDENT}" | /usr/bin/sed -En "s/.+\((.+)\)/\1/p")
}

View File

@ -0,0 +1,156 @@
$CIWorkflow = "${CheckoutDir}/.github/workflows/main.yml"
$WorkflowContent = Get-Content ${CIWorkflow}
$CIDepsVersion = ${WorkflowContent} | Select-String "[ ]+DEPS_VERSION_WIN: '([0-9\-]+)'" | ForEach-Object{$_.Matches.Groups[1].Value}
$CIQtVersion = ${WorkflowContent} | Select-String "[ ]+QT_VERSION_WIN: '([0-9\.]+)'" | ForEach-Object{$_.Matches.Groups[1].Value}
$CIVlcVersion = ${WorkflowContent} | Select-String "[ ]+VLC_VERSION_WIN: '(.+)'" | ForEach-Object{$_.Matches.Groups[1].Value}
$CICefVersion = ${WorkflowContent} | Select-String "[ ]+CEF_BUILD_VERSION_WIN: '([0-9\.]+)'" | ForEach-Object{$_.Matches.Groups[1].Value}
$CIGenerator = ${WorkflowContent} | Select-String "[ ]+CMAKE_GENERATOR: '(.+)'" | ForEach-Object{$_.Matches.Groups[1].Value}
function Write-Status {
Param(
[Parameter(Mandatory=$true)]
[String] $Output
)
if (!($Quiet.isPresent)) {
if (Test-Path Env:CI) {
Write-Host "[${ProductName}] ${Output}"
} else {
Write-Host -ForegroundColor blue "[${ProductName}] ${Output}"
}
}
}
function Write-Info {
Param(
[Parameter(Mandatory=$true)]
[String] $Output
)
if (!($Quiet.isPresent)) {
if (Test-Path Env:CI) {
Write-Host " + ${Output}"
} else {
Write-Host -ForegroundColor DarkYellow " + ${Output}"
}
}
}
function Write-Step {
Param(
[Parameter(Mandatory=$true)]
[String] $Output
)
if (!($Quiet.isPresent)) {
if (Test-Path Env:CI) {
Write-Host " + ${Output}"
} else {
Write-Host -ForegroundColor green " + ${Output}"
}
}
}
function Write-Failure {
Param(
[Parameter(Mandatory=$true)]
[String] $Output
)
if (Test-Path Env:CI) {
Write-Host " + ${Output}"
} else {
Write-Host -ForegroundColor red " + ${Output}"
}
}
function Test-CommandExists {
Param(
[Parameter(Mandatory=$true)]
[String] $Command
)
$CommandExists = $false
$OldActionPref = $ErrorActionPreference
$ErrorActionPreference = "stop"
try {
if (Get-Command $Command) {
$CommandExists = $true
}
} Catch {
$CommandExists = $false
} Finally {
$ErrorActionPreference = $OldActionPref
}
return $CommandExists
}
function Ensure-Directory {
Param(
[Parameter(Mandatory=$true)]
[String] $Directory
)
if (!(Test-Path $Directory)) {
$null = New-Item -ItemType Directory -Force -Path $Directory
}
Set-Location -Path $Directory
}
$BuildDirectory = "$(if (Test-Path Env:BuildDirectory) { $env:BuildDirectory } else { $BuildDirectory })"
$BuildConfiguration = "$(if (Test-Path Env:BuildConfiguration) { $env:BuildConfiguration } else { $BuildConfiguration })"
$BuildArch = "$(if (Test-Path Env:BuildArch) { $env:BuildArch } else { $BuildArch })"
$WindowsDepsVersion = "$(if (Test-Path Env:WindowsDepsVersion ) { $env:WindowsDepsVersion } else { $CIDepsVersion })"
$WindowsQtVersion = "$(if (Test-Path Env:WindowsQtVersion ) { $env:WindowsQtVersion } else { $CIQtVersion })"
$WindowsVlcVersion = "$(if (Test-Path Env:WindowsVlcVersion ) { $env:WindowsVlcVersion } else { $CIVlcVersion })"
$WindowsCefVersion = "$(if (Test-Path Env:WindowsCefVersion ) { $env:WindowsCefVersion } else { $CICefVersion })"
$CmakeSystemVersion = "$(if (Test-Path Env:CMAKE_SYSTEM_VERSION) { $Env:CMAKE_SYSTEM_VERSION } else { "10.0.18363.657" })"
$CmakeGenerator = "$(if (Test-Path Env:CmakeGenerator) { $Env:CmakeGenerator } else { $CIGenerator })"
function Install-Windows-Dependencies {
$WingetFile = "$PSScriptRoot/Wingetfile"
$Host64Bit = [System.Environment]::Is64BitOperatingSystem
$Prefix = (${Env:ProgramFiles(x86)}, $Env:ProgramFiles)[$Host64Bit]
$Paths = $Env:Path -split [System.IO.Path]::PathSeparator
$WingetOptions = @('install', '--accept-package-agreements', '--accept-source-agreements')
if ( $script:Quiet ) {
$WingetOptions += '--silent'
}
Get-Content $WingetFile | ForEach-Object {
$_, $Package, $_, $Path, $_, $Binary = $_ -replace ',','' -replace "'", '' -split ' '
$FullPath = "${Prefix}\${Path}"
if ( ( Test-Path $FullPath ) -and ! ( $Paths -contains $FullPath ) ) {
$Paths += $FullPath
$Env:Path = $Paths -join [System.IO.Path]::PathSeparator
}
Write-Step "Checking for command ${Binary}"
$Found = Get-Command -ErrorAction SilentlyContinue $Binary
if ( $Found ) {
Write-Info "Found dependency ${Binary} as $($Found.Source)"
} else {
Write-Info "Installing package ${Package}"
try {
$Params = $WingetOptions + $Package
winget @Params
} catch {
throw "Error while installing winget package ${Package}: $_"
}
}
}
}

View File

@ -1,52 +0,0 @@
#!/bin/sh
set -ex
curl -L https://packagecloud.io/github/git-lfs/gpgkey | sudo apt-key add -
sudo apt-get -qq update
sudo apt-get install -y \
build-essential \
checkinstall \
cmake \
libasound2-dev \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libcurl4-openssl-dev \
libfdk-aac-dev \
libfontconfig-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libjack-jackd2-dev \
libjansson-dev \
libluajit-5.1-dev \
libpulse-dev \
libqt5x11extras5-dev \
libspeexdsp-dev \
libswresample-dev \
libswscale-dev \
libudev-dev \
libv4l-dev \
libva-dev \
libvlc-dev \
libx11-dev \
libx264-dev \
libxkbcommon-dev \
libxcb-randr0-dev \
libxcb-shm0-dev \
libxcb-xinerama0-dev \
libxcomposite-dev \
libxinerama-dev \
libmbedtls-dev \
pkg-config \
python3-dev \
qtbase5-dev \
qtbase5-private-dev \
libqt5svg5-dev \
swig
# build cef
wget --quiet --retry-connrefused --waitretry=1 https://cdn-fastly.obsproject.com/downloads/cef_binary_${LINUX_CEF_BUILD_VERSION}_linux64.tar.bz2
tar -xjf ./cef_binary_${LINUX_CEF_BUILD_VERSION}_linux64.tar.bz2

View File

@ -1,4 +0,0 @@
if exist Qt_5.15.2.7z (curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_5.15.2.7z -f --retry 5 -z Qt_5.15.2.7z) else (curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_5.15.2.7z -f --retry 5 -C -)
7z x Qt_5.15.2.7z -oQt
mv Qt C:\QtDep
dir C:\QtDep

View File

@ -1,4 +0,0 @@
#!/bin/sh
set -ex
build_config=RelWithDebInfo

View File

@ -1,30 +0,0 @@
if exist dependencies2019.zip (curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies2019.zip -f --retry 5 -z dependencies2019.zip) else (curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies2019.zip -f --retry 5 -C -)
if exist vlc.zip (curl -kLO https://cdn-fastly.obsproject.com/downloads/vlc.zip -f --retry 5 -z vlc.zip) else (curl -kLO https://cdn-fastly.obsproject.com/downloads/vlc.zip -f --retry 5 -C -)
if exist cef_binary_%CEF_VERSION%_windows32_minimal.zip (curl -kLO https://cdn-fastly.obsproject.com/downloads/cef_binary_%CEF_VERSION%_windows32_minimal.zip -f --retry 5 -z cef_binary_%CEF_VERSION%_windows32_minimal.zip) else (curl -kLO https://cdn-fastly.obsproject.com/downloads/cef_binary_%CEF_VERSION%_windows32_minimal.zip -f --retry 5 -C -)
if exist cef_binary_%CEF_VERSION%_windows64_minimal.zip (curl -kLO https://cdn-fastly.obsproject.com/downloads/cef_binary_%CEF_VERSION%_windows64_minimal.zip -f --retry 5 -z cef_binary_%CEF_VERSION%_windows64_minimal.zip) else (curl -kLO https://cdn-fastly.obsproject.com/downloads/cef_binary_%CEF_VERSION%_windows64_minimal.zip -f --retry 5 -C -)
7z x dependencies2019.zip -odependencies2019
7z x vlc.zip -ovlc
7z x cef_binary_%CEF_VERSION%_windows32_minimal.zip -oCEF_32
7z x cef_binary_%CEF_VERSION%_windows64_minimal.zip -oCEF_64
set DepsPath32=%CD%\dependencies2019\win32
set DepsPath64=%CD%\dependencies2019\win64
set VLCPath=%CD%\vlc
set QTDIR32=C:\QtDep\5.15.2\msvc2019
set QTDIR64=C:\QtDep\5.15.2\msvc2019_64
set CEF_32=%CD%\CEF_32\cef_binary_%CEF_VERSION%_windows32_minimal
set CEF_64=%CD%\CEF_64\cef_binary_%CEF_VERSION%_windows64_minimal
set build_config=RelWithDebInfo
set VIRTUALCAM-GUID=A3FCE0F5-3493-419F-958A-ABA1250EC20B
mkdir build build32 build64
if "%TWITCH-CLIENTID%"=="$(twitch_clientid)" (
cd ./build32
cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true -DENABLE_VLC=ON -DCOMPILE_D3D12_HOOK=true -DBUILD_BROWSER=true -DCEF_ROOT_DIR=%CEF_32% -DVIRTUALCAM_GUID="%VIRTUALCAM-GUID%" ..
cd ../build64
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true -DENABLE_VLC=ON -DCOMPILE_D3D12_HOOK=true -DBUILD_BROWSER=true -DCEF_ROOT_DIR=%CEF_64% -DVIRTUALCAM_GUID="%VIRTUALCAM-GUID%" ..
) else (
cd ./build32
cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true -DENABLE_VLC=ON -DCOMPILE_D3D12_HOOK=true -DBUILD_BROWSER=true -DCEF_ROOT_DIR=%CEF_32% -DTWITCH_CLIENTID="%TWITCH-CLIENTID%" -DTWITCH_HASH="%TWITCH-HASH%" -DRESTREAM_CLIENTID="%RESTREAM-CLIENTID%" -DRESTREAM_HASH="%RESTREAM-HASH%" -DVIRTUALCAM_GUID="%VIRTUALCAM-GUID%" ..
cd ../build64
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true -DENABLE_VLC=ON -DCOMPILE_D3D12_HOOK=true -DBUILD_BROWSER=true -DCEF_ROOT_DIR=%CEF_64% -DTWITCH_CLIENTID="%TWITCH-CLIENTID%" -DTWITCH_HASH="%TWITCH-HASH%" -DRESTREAM_CLIENTID="%RESTREAM-CLIENTID%" -DRESTREAM_HASH="%RESTREAM-HASH%" -DVIRTUALCAM_GUID="%VIRTUALCAM-GUID%" ..
)
cd ..

View File

@ -0,0 +1,136 @@
#!/bin/bash
##############################################################################
# Linux dependency management function
##############################################################################
#
# This script file can be included in build scripts for Linux or run directly
# with the -s/--standalone switch
#
##############################################################################
# Halt on errors
set -eE
install_build-deps() {
shift
status "Install OBS build dependencies"
trap "caught_error 'install_build-deps'" ERR
sudo apt-get install -y $@
}
install_obs-deps() {
shift
status "Install OBS dependencies"
trap "caught_error 'install_obs-deps'" ERR
if [ -z "${DISABLE_PIPEWIRE}" ]; then
sudo apt-get install -y $@ libpipewire-0.3-dev
else
sudo apt-get install -y $@
fi
}
install_qt-deps() {
shift
status "Install Qt dependencies"
trap "caught_error 'install_qt-deps'" ERR
sudo apt-get install -y $@
}
install_cef() {
shift
status "Setup for dependency CEF v${1}"
ensure_dir "${DEPS_BUILD_DIR}"
if [ "${CI}" -a "${RESTORED_CEF}" ]; then
_SKIP=TRUE
elif [ -d "${DEPS_BUILD_DIR}/cef_binary_${1}_linux64" -a -f "${DEPS_BUILD_DIR}/cef_binary_${1}_linux64/build/libcef_dll_wrapper/libcef_dll_wrapper.a" ]; then
_SKIP=TRUE
fi
if [ -z "${_SKIP}" ]; then
step "Download..."
${CURLCMD:-curl -O} https://cdn-fastly.obsproject.com/downloads/cef_binary_${1}_linux64.tar.bz2
step "Unpack..."
tar -xf cef_binary_${1}_linux64.tar.bz2
else
step "Found existing Chromium Embedded Framework and loader library..."
fi
}
install_plugin-deps() {
shift
status "Install plugin dependencies"
trap "caught_error 'install_plugin-deps'" ERR
sudo apt-get install -y $@
}
install_dependencies() {
status "Set up apt"
trap "caught_error 'install_dependencies'" ERR
BUILD_DEPS=(
"build-deps cmake ninja-build pkg-config clang clang-format build-essential curl ccache"
"obs-deps libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev \
libswscale-dev libx264-dev libcurl4-openssl-dev libmbedtls-dev libgl1-mesa-dev libjansson-dev \
libluajit-5.1-dev python3-dev libx11-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-xinerama0-dev \
libxcomposite-dev libxinerama-dev libxcb1-dev libx11-xcb-dev libxcb-xfixes0-dev swig libcmocka-dev \
libpci-dev libxss-dev libglvnd-dev libgles2-mesa libgles2-mesa-dev libwayland-dev libxkbcommon-dev"
"qt-deps qtbase5-dev qtbase5-private-dev libqt5svg5-dev qtwayland5"
"cef ${LINUX_CEF_BUILD_VERSION:-${CI_LINUX_CEF_VERSION}}"
"plugin-deps libasound2-dev libfdk-aac-dev libfontconfig-dev libfreetype6-dev libjack-jackd2-dev \
libpulse-dev libsndio-dev libspeexdsp-dev libudev-dev libv4l-dev libva-dev libvlc-dev libdrm-dev"
)
sudo dpkg --add-architecture amd64
sudo apt-get -qq update
for DEPENDENCY in "${BUILD_DEPS[@]}"; do
set -- ${DEPENDENCY}
trap "caught_error ${DEPENDENCY}" ERR
FUNC_NAME="install_${1}"
${FUNC_NAME} ${@}
done
}
install-dependencies-standalone() {
CHECKOUT_DIR="$(/usr/bin/git rev-parse --show-toplevel)"
PRODUCT_NAME="OBS-Studio"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
source "${CHECKOUT_DIR}/CI/include/build_support.sh"
source "${CHECKOUT_DIR}/CI/include/build_support_linux.sh"
status "Setup of OBS build dependencies"
install_dependencies
}
print_usage() {
echo -e "Usage: ${0}\n" \
"-h, --help : Print this help\n" \
"-q, --quiet : Suppress most build process output\n" \
"-v, --verbose : Enable more verbose build process output\n" \
"--disable-pipewire : Disable building with Pipewire support (default: off)\n"
}
install-dependencies-main() {
if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then
while true; do
case "${1}" in
-h | --help ) print_usage; exit 0 ;;
-q | --quiet ) export QUIET=TRUE; shift ;;
-v | --verbose ) export VERBOSE=TRUE; shift ;;
--disable-pipewire ) DISABLE_PIPEWIRE=TRUE; shift ;;
-- ) shift; break ;;
* ) break ;;
esac
done
install-dependencies-standalone
fi
}
install-dependencies-main $*

127
CI/linux/02_build_obs.sh Executable file
View File

@ -0,0 +1,127 @@
#!/bin/bash
##############################################################################
# Linux build function
##############################################################################
#
# This script file can be included in build scripts for Linux or run directly
#
##############################################################################
# Halt on errors
set -eE
build_obs() {
status "Build OBS"
trap "caught_error 'build app'" ERR
if [ -z "${CI}" ]; then
_backup_artifacts
fi
step "Configure OBS..."
_configure_obs
ensure_dir "${CHECKOUT_DIR}/"
step "Build OBS targets..."
cmake --build ${BUILD_DIR}
}
# Function to configure OBS build
_configure_obs() {
ensure_dir "${CHECKOUT_DIR}"
status "Configuration of OBS build system..."
trap "caught_error 'configure build'" ERR
check_ccache
if [ "${TWITCH_CLIENTID}" -a "${TWICH_HASH}" ]; then
TWITCH_OPTIONS="-DTWITCH_CLIENTID=\"${TWITCH_CLIENTID}\" -DTWITCH_HASH=\"${TWITCH_HASH}\""
fi
if [ "${RESTREAM_CLIENTID}" -a "${RESTREAM_HASH}" ]; then
RESTREAM_OPTIONS="-DRESTREAM_CLIENTID=\"${RESTREAM_CLIENTID}\" -DRESTREAM_HASH=\"${RESTREAM_HASH}\""
fi
if [ "${YOUTUBE_CLIENTID}" -a "${YOUTUBE_CLIENTID_HASH}" -a "${YOUTUBE_SECRET}" -a "{YOUTUBE_SECRET_HASH}" ]; then
YOUTUBE_OPTIONS="-DYOUTUBE_CLIENTID=\"${YOUTUBE_CLIENTID}\" -DYOUTUBE_CLIENTID_HASH=\"${YOUTUBE_CLIENTID_HASH}\" -DYOUTUBE_SECRET=\"${YOUTUBE_SECRET}\" -DYOUTUBE_SECRET_HASH=\"${YOUTUBE_SECRET_HASH}\""
fi
if [ "${PORTABLE}" ]; then
PORTABLE_BUILD="ON"
fi
if [ "${DISABLE_PIPEWIRE}" ]; then
PIPEWIRE_OPTION="-DENABLE_PIPEWIRE=OFF"
fi
cmake -S . -B ${BUILD_DIR} -G Ninja \
-DCEF_ROOT_DIR="${DEPS_BUILD_DIR}/cef_binary_${LINUX_CEF_BUILD_VERSION:-${CI_LINUX_CEF_VERSION}}_linux64" \
-DCMAKE_BUILD_TYPE=${BUILD_CONFIG} \
-DLINUX_PORTABLE=${PORTABLE_BUILD:-OFF} \
-DENABLE_AJA=OFF \
${PIPEWIRE_OPTION} \
${YOUTUBE_OPTIONS} \
${TWITCH_OPTIONS} \
${RESTREAM_OPTIONS} \
${CI:+-DENABLE_UNIT_TESTS=ON -DBUILD_FOR_DISTRIBUTION=${BUILD_FOR_DISTRIBUTION} -DOBS_BUILD_NUMBER=${GITHUB_RUN_ID}} \
${QUIET:+-Wno-deprecated -Wno-dev --log-level=ERROR}
}
# Function to backup previous build artifacts
_backup_artifacts() {
ensure_dir "${CHECKOUT_DIR}"
if [ -d ${BUILD_DIR} ]; then
status "Backup of old OBS build artifacts"
CUR_DATE=$(date +"%Y-%m-%d@%H%M%S")
NIGHTLY_DIR="${CHECKOUT_DIR}/nightly-${CUR_DATE}"
PACKAGE_NAME=$(find ${BUILD_DIR} -maxdepth 1 -name "*.deb" | sort -rn | head -1)
if [ "${PACKAGE_NAME}" ]; then
step "Back up $(basename "${PACKAGE_NAME}")..."
ensure_dir "${NIGHTLY_DIR}"
mv "../${BUILD_DIR}/$(basename "${PACKAGE_NAME}")" ${NIGHTLY_DIR}/
info "You can find ${PACKAGE_NAME} in ${NIGHTLY_DIR}"
fi
fi
}
build-obs-standalone() {
CHECKOUT_DIR="$(git rev-parse --show-toplevel)"
PRODUCT_NAME="OBS-Studio"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
source "${CHECKOUT_DIR}/CI/include/build_support.sh"
source "${CHECKOUT_DIR}/CI/include/build_support_linux.sh"
build_obs
}
print_usage() {
echo -e "Usage: ${0}\n" \
"-h, --help : Print this help\n" \
"-q, --quiet : Suppress most build process output\n" \
"-v, --verbose : Enable more verbose build process output\n" \
"-p, --portable : Create portable build (default: off)\n" \
"--disable-pipewire : Disable building with PipeWire support (default: off)\n" \
"--build-dir : Specify alternative build directory (default: build)\n"
}
build-obs-main() {
if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then
while true; do
case "${1}" in
-h | --help ) print_usage; exit 0 ;;
-q | --quiet ) export QUIET=TRUE; shift ;;
-v | --verbose ) export VERBOSE=TRUE; shift ;;
-p | --portable ) export PORTABLE=TRUE; shift ;;
--disable-pipewire ) DISABLE_PIPEWIRE=TRUE; shift ;;
--build-dir ) BUILD_DIR="${2}"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done
build-obs-standalone
fi
}
build-obs-main $*

82
CI/linux/03_package_obs.sh Executable file
View File

@ -0,0 +1,82 @@
#!/bin/bash
##############################################################################
# Linux libobs plugin package function
##############################################################################
#
# This script file can be included in build scripts for Linux or run directly
#
##############################################################################
# Halt on errors
set -eE
package_obs() {
status "Create Linux debian package"
trap "caught_error 'package app'" ERR
ensure_dir "${CHECKOUT_DIR}"
step "Package OBS..."
cmake --build ${BUILD_DIR} -t package
DEB_NAME=$(find ${BUILD_DIR} -maxdepth 1 -type f -name "obs*.deb" | sort -rn | head -1)
if [ "${DEB_NAME}" ]; then
mv ${DEB_NAME} ${BUILD_DIR}/${FILE_NAME}
else
error "ERROR No suitable OBS debian package generated"
fi
}
package-obs-standalone() {
PRODUCT_NAME="OBS-Studio"
CHECKOUT_DIR="$(git rev-parse --show-toplevel)"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
source "${CHECKOUT_DIR}/CI/include/build_support.sh"
source "${CHECKOUT_DIR}/CI/include/build_support_linux.sh"
step "Fetch OBS tags..."
git fetch origin --tags
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
GIT_HASH=$(git rev-parse --short HEAD)
GIT_TAG=$(git describe --tags --abbrev=0)
if [ "${BUILD_FOR_DISTRIBUTION}" ]; then
VERSION_STRING="${GIT_TAG}"
else
VERSION_STRING="${GIT_TAG}-${GIT_HASH}"
fi
FILE_NAME="obs-studio-${VERSION_STRING}-Linux.deb"
package_obs
}
print_usage() {
echo -e "Usage: ${0}\n" \
"-h, --help : Print this help\n" \
"-q, --quiet : Suppress most build process output\n" \
"-v, --verbose : Enable more verbose build process output\n" \
"--build-dir : Specify alternative build directory (default: build)\n"
}
package-obs-main() {
if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then
while true; do
case "${1}" in
-h | --help ) print_usage; exit 0 ;;
-q | --quiet ) export QUIET=TRUE; shift ;;
-v | --verbose ) export VERBOSE=TRUE; shift ;;
--build-dir ) BUILD_DIR="${2}"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done
package-obs-standalone
fi
}
package-obs-main $*

View File

@ -0,0 +1,182 @@
#!/bin/bash
##############################################################################
# macOS dependency management function
##############################################################################
#
# This script file can be included in build scripts for macOS or run directly.
#
##############################################################################
# Halt on errors
set -eE
install_obs-deps() {
status "Set up precompiled macOS OBS dependencies v${1}"
ensure_dir "${DEPS_BUILD_DIR}"
step "Download..."
check_and_fetch "https://github.com/obsproject/obs-deps/releases/download/${1}/macos-deps-${1}-${ARCH:-x86_64}.tar.xz" "${2}"
mkdir -p obs-deps
step "Unpack..."
/usr/bin/tar -xf "./macos-deps-${1}-${ARCH:-x86_64}.tar.xz" -C ./obs-deps
/usr/bin/xattr -r -d com.apple.quarantine ./obs-deps
}
install_qt-deps() {
status "Set up precompiled dependency Qt v${1}"
ensure_dir "${DEPS_BUILD_DIR}"
step "Download..."
check_and_fetch "https://github.com/obsproject/obs-deps/releases/download/${1}/macos-deps-qt-${1}-${ARCH:-x86_64}.tar.xz" "${2}"
mkdir -p obs-deps
step "Unpack..."
/usr/bin/tar -xf "./macos-deps-qt-${1}-${ARCH:-x86_64}.tar.xz" -C ./obs-deps
/usr/bin/xattr -r -d com.apple.quarantine ./obs-deps
}
install_vlc() {
status "Set up dependency VLC v${1}"
ensure_dir "${DEPS_BUILD_DIR}"
unset _SKIP
if [ "${CI}" -a "${RESTORED_VLC}" ]; then
_SKIP=TRUE
elif [ -d "${DEPS_BUILD_DIR}/vlc-${1}" -a -f "${DEPS_BUILD_DIR}/vlc-${1}/include/vlc/vlc.h" ]; then
_SKIP=TRUE
fi
if [ -z "${_SKIP}" ]; then
step "Download..."
check_and_fetch "https://downloads.videolan.org/vlc/${1}/vlc-${1}.tar.xz" "${2}"
step "Unpack..."
/usr/bin/tar -xf vlc-${1}.tar.xz
else
step "Found existing VLC..."
fi
}
install_sparkle() {
status "Set up dependency Sparkle v${1}"
ensure_dir "${DEPS_BUILD_DIR}"
unset _SKIP
if [ "${CI}" -a "${RESTORED_SPARKLE}" ]; then
_SKIP=TRUE
elif [ -d "${DEPS_BUILD_DIR}/obs-deps/Frameworks/Sparkle.framework" -a -f "${DEPS_BUILD_DIR}/obs-deps/Frameworks/Sparkle.framework/Sparkle" ]; then
_SKIP=TRUE
fi
if [ -z "${_SKIP}" ]; then
step "Download..."
check_and_fetch "https://github.com/sparkle-project/Sparkle/releases/download/${1}/Sparkle-${1}.tar.xz" "${2}"
step "Unpack..."
ensure_dir "${DEPS_BUILD_DIR}/sparkle"
/usr/bin/tar -xf ../Sparkle-${1}.tar.xz
cp -cpR "${DEPS_BUILD_DIR}"/sparkle/Sparkle.framework "${DEPS_BUILD_DIR}"/obs-deps/lib/
else
step "Found existing Sparkle Framework..."
fi
}
install_cef() {
status "Set up dependency CEF v${1}"
ensure_dir "${DEPS_BUILD_DIR}"
unset _SKIP
if [ "${CI}" -a "${RESTORED_CEF}" ]; then
_SKIP=TRUE
elif [ -d "${DEPS_BUILD_DIR}/cef_binary_${1}_macos_${ARCH:-x86_64}" -a -f "${DEPS_BUILD_DIR}/cef_binary_${1}_macos_${ARCH:-x86_64}/build/libcef_dll_wrapper/libcef_dll_wrapper.a" ]; then
_SKIP=TRUE
fi
if [ -z "${_SKIP}" ]; then
step "Download..."
check_and_fetch "https://cdn-fastly.obsproject.com/downloads/cef_binary_${1}_macos_${ARCH:-x86_64}.tar.xz" "${2}"
step "Unpack..."
/usr/bin/tar -xf cef_binary_${1}_macos_${ARCH:-x86_64}.tar.xz
cd cef_binary_${1}_macos_${ARCH:-x86_64}
step "Fix tests..."
/usr/bin/sed -i '.orig' '/add_subdirectory(tests\/ceftests)/d' ./CMakeLists.txt
/usr/bin/sed -E -i '' 's/"10.(9|10|11)"/"'${MACOSX_DEPLOYMENT_TARGET:-${CI_MACOSX_DEPLOYMENT_TARGET}}'"/' ./cmake/cef_variables.cmake
step "Run CMake..."
check_ccache
cmake ${CCACHE_OPTIONS} ${QUIET:+-Wno-deprecated -Wno-dev --log-level=ERROR} \
-S . -B build \
-G Ninja \
-DPROJECT_ARCH=${CMAKE_ARCHS:-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=${MACOSX_DEPLOYMENT_TARGET:-${CI_MACOSX_DEPLOYMENT_TARGET}}
step "Build CEF v${1}..."
cmake --build build
mkdir -p build/libcef_dll
else
step "Found existing Chromium Embedded Framework and loader library..."
fi
}
install_dependencies() {
status "Install Homebrew dependencies"
trap "caught_error 'install_dependencies'" ERR
BUILD_DEPS=(
"obs-deps ${MACOS_DEPS_VERSION:-${CI_DEPS_VERSION}} ${MACOS_DEPS_HASH:-${CI_DEPS_HASH}}"
"qt-deps ${MACOS_DEPS_VERSION:-${CI_DEPS_VERSION}} ${QT_HASH:-${CI_QT_HASH}}"
"cef ${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}} ${CEF_HASH:-${CI_CEF_HASH}}"
"vlc ${VLC_VERSION:-${CI_VLC_VERSION}} ${VLC_HASH:-${CI_VLC_HASH}}"
"sparkle ${SPARKLE_VERSION:-${CI_SPARKLE_VERSION}} ${SPARKLE_HASH:-${CI_SPARKLE_HASH}}"
)
install_homebrew_deps
for DEPENDENCY in "${BUILD_DEPS[@]}"; do
set -- ${DEPENDENCY}
trap "caught_error ${DEPENDENCY}" ERR
FUNC_NAME="install_${1}"
${FUNC_NAME} ${2} ${3} ${4}
done
}
install-dependencies-standalone() {
CHECKOUT_DIR="$(/usr/bin/git rev-parse --show-toplevel)"
PRODUCT_NAME="OBS-Studio"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
source "${CHECKOUT_DIR}/CI/include/build_support.sh"
source "${CHECKOUT_DIR}/CI/include/build_support_macos.sh"
status "Setup of OBS build dependencies"
check_macos_version
check_archs
install_dependencies
}
print_usage() {
echo -e "Usage: ${0}\n" \
"-h, --help : Print this help\n" \
"-q, --quiet : Suppress most build process output\n" \
"-v, --verbose : Enable more verbose build process output\n" \
"-a, --architecture : Specify build architecture (default: x86_64, alternative: arm64)\n"
}
install-dependencies-main() {
if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then
while true; do
case "${1}" in
-h | --help ) print_usage; exit 0 ;;
-q | --quiet ) export QUIET=TRUE; shift ;;
-v | --verbose ) export VERBOSE=TRUE; shift ;;
-a | --architecture ) ARCH="${2}"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done
install-dependencies-standalone
fi
}
install-dependencies-main $*

168
CI/macos/02_build_obs.sh Executable file
View File

@ -0,0 +1,168 @@
#!/bin/bash
##############################################################################
# macOS build function
##############################################################################
#
# This script file can be included in build scripts for macOS or run directly
#
##############################################################################
# Halt on errors
set -eE
build_obs() {
status "Build OBS"
trap "caught_error 'build app'" ERR
if [ -z "${CI}" ]; then
_backup_artifacts
fi
step "Configure OBS..."
_configure_obs
ensure_dir "${CHECKOUT_DIR}/"
step "Build OBS targets..."
cmake --build ${BUILD_DIR}
}
bundle_obs() {
status "Create relocatable macOS application bundle"
trap "caught_error 'package app'" ERR
ensure_dir "${CHECKOUT_DIR}"
step "Install OBS application bundle..."
cmake --install ${BUILD_DIR}
}
# Function to configure OBS build
_configure_obs() {
if [ "${CODESIGN}" ]; then
read_codesign_ident
fi
ensure_dir "${CHECKOUT_DIR}"
status "Configure OBS build system..."
trap "caught_error 'configure build'" ERR
check_ccache
if [ "${TWITCH_CLIENTID}" -a "${TWICH_HASH}" ]; then
TWITCH_OPTIONS="-DTWITCH_CLIENTID=\"${TWITCH_CLIENTID}\" -DTWITCH_HASH=\"${TWITCH_HASH}\""
fi
if [ "${RESTREAM_CLIENTID}" -a "${RESTREAM_HASH}" ]; then
RESTREAM_OPTIONS="-DRESTREAM_CLIENTID=\"${RESTREAM_CLIENTID}\" -DRESTREAM_HASH=\"${RESTREAM_HASH}\""
fi
if [ "${YOUTUBE_CLIENTID}" -a "${YOUTUBE_CLIENTID_HASH}" -a "${YOUTUBE_SECRET}" -a "{YOUTUBE_SECRET_HASH}" ]; then
YOUTUBE_OPTIONS="-DYOUTUBE_CLIENTID=\"${YOUTUBE_CLIENTID}\" -DYOUTUBE_CLIENTID_HASH=\"${YOUTUBE_CLIENTID_HASH}\" -DYOUTUBE_SECRET=\"${YOUTUBE_SECRET}\" -DYOUTUBE_SECRET_HASH=\"${YOUTUBE_SECRET_HASH}\""
fi
if [ "${XCODE}" ]; then
GENERATOR="Xcode"
else
GENERATOR="Ninja"
fi
if [ "${CI}" -a "${ARCH}" = "x86_64" ]; then
UNITTEST_OPTIONS="-DENABLE_UNIT_TESTS=ON"
fi
cmake -S . -B ${BUILD_DIR} -G ${GENERATOR} \
-DCEF_ROOT_DIR="${DEPS_BUILD_DIR}/cef_binary_${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}}_macos_${ARCH:-x86_64}" \
-DENABLE_BROWSER=ON \
-DVLC_PATH="${DEPS_BUILD_DIR}/vlc-${VLC_VERSION:-${CI_VLC_VERSION}}" \
-DENABLE_VLC=ON \
-DCMAKE_PREFIX_PATH="${DEPS_BUILD_DIR}/obs-deps" \
-DBROWSER_LEGACY=$(test "${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}}" -le 3770 && echo "ON" || echo "OFF") \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-${CI_MACOSX_DEPLOYMENT_TARGET}} \
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_ARCHS} \
-DOBS_CODESIGN_LINKER=${CODESIGN_LINKER:-OFF} \
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR}/install \
-DCMAKE_BUILD_TYPE=${BUILD_CONFIG} \
-DOBS_BUNDLE_CODESIGN_IDENTITY="${CODESIGN_IDENT:--}" \
${YOUTUBE_OPTIONS} \
${TWITCH_OPTIONS} \
${RESTREAM_OPTIONS} \
${UNITTEST_OPTIONS} \
${CI:+-DBUILD_FOR_DISTRIBUTION=${BUILD_FOR_DISTRIBUTION} -DOBS_BUILD_NUMBER=${GITHUB_RUN_ID}} \
${QUIET:+-Wno-deprecated -Wno-dev --log-level=ERROR}
}
# Function to backup previous build artifacts
_backup_artifacts() {
ensure_dir "${CHECKOUT_DIR}"
if [ -d "${BUILD_DIR}" ]; then
status "Backup old OBS build artifacts"
CUR_DATE=$(/bin/date +"%Y-%m-%d@%H%M%S")
NIGHTLY_DIR="${CHECKOUT_DIR}/nightly-${CUR_DATE}"
PACKAGE_NAME=$(/usr/bin/find "${BUILD_DIR}" -name "*.dmg" -depth 1 | sort -rn | head -1)
if [ -d "${BUILD_DIR}/install/OBS.app" ]; then
step "Back up OBS.app..."
ensure_dir "${NIGHTLY_DIR}"
/bin/mv "${CHECKOUT_DIR}/${BUILD_DIR}/install/OBS.app" "${NIGHTLY_DIR}/"
info "You can find OBS.app in ${NIGHTLY_DIR}"
fi
if [ "${PACKAGE_NAME}" ]; then
step "Back up $(basename "${PACKAGE_NAME}")..."
ensure_dir "${NIGHTLY_DIR}"
/bin/mv "../${BUILD_DIR}/$(basename "${PACKAGE_NAME}")" "${NIGHTLY_DIR}/"
info "You can find ${PACKAGE_NAME} in ${NIGHTLY_DIR}"
fi
fi
}
build-obs-standalone() {
CHECKOUT_DIR="$(/usr/bin/git rev-parse --show-toplevel)"
PRODUCT_NAME="OBS-Studio"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
source "${CHECKOUT_DIR}/CI/include/build_support.sh"
source "${CHECKOUT_DIR}/CI/include/build_support_macos.sh"
check_archs
check_macos_version
build_obs
if [ "${BUNDLE}" ]; then
bundle_obs
fi
}
print_usage() {
echo -e "Usage: ${0}\n" \
"-h, --help : Print this help\n" \
"-q, --quiet : Suppress most build process output\n" \
"-v, --verbose : Enable more verbose build process output\n" \
"-a, --architecture : Specify build architecture (default: x86_64, alternative: arm64)\n" \
"-c, --codesign : Codesign OBS and all libraries (default: ad-hoc only)\n" \
"-b, --bundle : Create relocatable OBS application bundle in build directory (default: build/install/OBS.app)\n" \
"--xcode : Create Xcode build environment instead of Ninja\n" \
"--build-dir : Specify alternative build directory (default: build)\n"
}
build-obs-main() {
if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then
while true; do
case "${1}" in
-h | --help ) print_usage; exit 0 ;;
-q | --quiet ) export QUIET=TRUE; shift ;;
-v | --verbose ) export VERBOSE=TRUE; shift ;;
-a | --architecture ) ARCH="${2}"; shift 2 ;;
-c | --codesign ) CODESIGN=TRUE; shift ;;
-b | --bundle ) BUNDLE=TRUE; shift ;;
--xcode ) XCODE=TRUE; shift ;;
--build-dir ) BUILD_DIR="${2}"; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done
build-obs-standalone
fi
}
build-obs-main $*

187
CI/macos/03_package_obs.sh Executable file
View File

@ -0,0 +1,187 @@
#!/bin/bash
##############################################################################
# macOS libobs plugin package function
##############################################################################
#
# This script file can be included in build scripts for macOS or run directly
#
##############################################################################
# Halt on errors
set -eE
package_obs() {
if [ "${CODESIGN}" ]; then
read_codesign_ident
fi
status "Create macOS disk image"
trap "caught_error 'package app'" ERR
info "/!\\ CPack will use an AppleScript to create the disk image, this will lead to a Finder window opening to adjust window settings. /!\\"
ensure_dir "${CHECKOUT_DIR}"
step "Package OBS..."
cmake --build ${BUILD_DIR} -t package
DMG_NAME=$(/usr/bin/find "${BUILD_DIR}" -type f -name "OBS-*.dmg" -depth 1 | sort -rn | head -1)
if [ "${DMG_NAME}" ]; then
mv "${DMG_NAME}" "${BUILD_DIR}/${FILE_NAME}"
step "Codesign OBS disk image..."
/usr/bin/codesign --force --sign "${CODESIGN_IDENT:--}" "${BUILD_DIR}/${FILE_NAME}"
else
error "ERROR No suitable OBS disk image generated"
fi
}
notarize_obs() {
status "Notarize OBS"
trap "caught_error 'notarizing app'" ERR
if ! exists brew; then
error "ERROR Homebrew not found - please install homebrew (https://brew.sh)"
exit 1
fi
if ! exists xcnotary; then
step "Install notarization dependency 'xcnotary'"
brew install akeru-inc/tap/xcnotary
fi
ensure_dir "${CHECKOUT_DIR}"
if [ "${NOTARIZE_IMAGE}" ]; then
trap "_caught_error_xcnotary '${NOTARIZE_IMAGE}'" ERR
step "Attach OBS disk image ${NOTARIZE_IMAGE}..."
hdiutil attach -readonly -noverify -noautoopen -quiet "${NOTARIZE_IMAGE}"
VOLUME_NAME=$(hdiutil info -plist | grep "/Volumes/OBS-" | sed 's/<string>\/Volumes\/\([^<]*\)<\/string>/\1/' | sed -e 's/^[[:space:]]*//')
PRECHECK="/Volumes/${VOLUME_NAME}/OBS.app"
NOTARIZE_TARGET="${NOTARIZE_IMAGE}"
elif [ "${NOTARIZE_BUNDLE}" ]; then
PRECHECK="${NOTARIZE_BUNDLE}"
NOTARIZE_TARGET="${NOTARIZE_BUNDLE}"
else
OBS_IMAGE="${BUILD_DIR}/${FILE_NAME}"
if [ -f "${OBS_IMAGE}" ]; then
OBS_BUNDLE=$(/usr/bin/find "${BUILD_DIR}/_CPack_Packages" -type d -name "OBS.app")
PRECHECK="${OBS_BUNDLE}"
NOTARIZE_TARGET="${OBS_IMAGE}"
else
error "No notarization application bundle ('OBS.app') or disk image ('${NOTARIZE_IMAGE:-${FILE_NAME}}') found"
return
fi
fi
step "Run notarization pre-checks on OBS.app..."
xcnotary precheck "${PRECHECK}"
if [ "$?" -eq 0 ]; then
read_codesign_ident
read_codesign_pass
step "Run xcnotary with ${NOTARIZE_TARGET}..."
xcnotary notarize "${NOTARIZE_TARGET}" --developer-account "${CODESIGN_IDENT_USER}" --developer-password-keychain-item "OBS-Codesign-Password" --provider "${CODESIGN_IDENT_SHORT}"
fi
if [ "${NOTARIZE_IMAGE}" -a -d "/Volumes/${VOLUME_NAME}" ]; then
step "Detach OBS disk image ${NOTARIZE_IMAGE}..."
hdiutil detach "/Volumes/${VOLUME_NAME}" -quiet
fi
}
_caught_error_xcnotary() {
error "ERROR during notarization of image '${1}'"
if [ -d "/Volumes/${1}" ]; then
step "Detach OBS disk image ${1}..."
hdiutil detach "/Volumes/${1}" -quiet
fi
cleanup
exit 1
}
package-obs-standalone() {
PRODUCT_NAME="OBS-Studio"
CHECKOUT_DIR="$(/usr/bin/git rev-parse --show-toplevel)"
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
source "${CHECKOUT_DIR}/CI/include/build_support.sh"
source "${CHECKOUT_DIR}/CI/include/build_support_macos.sh"
check_archs
check_macos_version
step "Fetch OBS tags..."
/usr/bin/git fetch origin --tags
GIT_BRANCH=$(/usr/bin/git rev-parse --abbrev-ref HEAD)
GIT_HASH=$(/usr/bin/git rev-parse --short HEAD)
GIT_TAG=$(/usr/bin/git describe --tags --abbrev=0)
if [ "${BUILD_FOR_DISTRIBUTION}" ]; then
VERSION_STRING="${GIT_TAG}"
else
VERSION_STRING="${GIT_TAG}-${GIT_HASH}"
fi
if [ -z "${NOTARIZE_IMAGE}" -a -z "${NOTARIZE_BUNDLE}" ]; then
if [ "${ARCH}" = "arm64" ]; then
FILE_NAME="obs-studio-${VERSION_STRING}-macOS-Apple.dmg"
elif [ "${ARCH}" = "universal" ]; then
FILE_NAME="obs-studio-${VERSION_STRING}-macOS.dmg"
else
FILE_NAME="obs-studio-${VERSION_STRING}-macOS-Intel.dmg"
fi
package_obs
fi
if [ "${NOTARIZE}" ]; then
notarize_obs
fi
}
print_usage() {
echo -e "Usage: ${0}\n" \
"-h, --help : Print this help\n" \
"-q, --quiet : Suppress most build process output\n" \
"-v, --verbose : Enable more verbose build process output\n" \
"-a, --architecture : Specify build architecture (default: x86_64, alternative: arm64)\n" \
"-c, --codesign : Codesign OBS and all libraries (default: ad-hoc only)\n" \
"-n, --notarize : Notarize OBS (default: off)\n" \
"--notarize-image [IMAGE] : Specify existing OBS disk image for notarization\n" \
"--notarize-bundle [BUNDLE] : Specify existing OBS application bundle for notarization\n" \
"--build-dir : Specify alternative build directory (default: build)\n"
}
package-obs-main() {
if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then
while true; do
case "${1}" in
-h | --help ) print_usage; exit 0 ;;
-q | --quiet ) export QUIET=TRUE; shift ;;
-v | --verbose ) export VERBOSE=TRUE; shift ;;
-a | --architecture ) ARCH="${2}"; shift 2 ;;
-c | --codesign ) CODESIGN=TRUE; shift ;;
-n | --notarize ) NOTARIZE=TRUE; CODESIGN=TRUE; shift ;;
--build-dir ) BUILD_DIR="${2}"; shift 2 ;;
--notarize-image ) NOTARIZE_IMAGE="${2}"; NOTARIZE=TRUE; CODESIGN=TRUE; shift 2 ;;
--notarize-bundle ) NOTARIZE_BUNDLE="${2}"; NOTARIZE=TRUE; CODESIGN=TRUE; shift 2 ;;
-- ) shift; break ;;
* ) break ;;
esac
done
package-obs-standalone
fi
}
package-obs-main $*

View File

@ -1,5 +0,0 @@
tap "akeru-inc/tap"
brew "cmake"
brew "freetype"
brew "cmocka"
brew "akeru-inc/tap/xcnotary"

Binary file not shown.

Binary file not shown.

View File

@ -1,28 +0,0 @@
{
"title": "OBS-Studio $$VERSION$$",
"background": "$$CI_PATH$$/package/background.tiff",
"icon": "$$CI_PATH$$/app/AppIcon.icns",
"format": "ULFO",
"icon-size": 96,
"window": {
"position": {
"x": 100,
"y": 100
},
"size": {
"width": 540,
"height": 380
}
},
"contents": [{
"x": 124,
"y": 180,
"type": "file",
"path": "$$BUNDLE_PATH$$/OBS.app"
}, {
"x": 416,
"y": 180,
"type": "link",
"path": "/Applications"
}]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

View File

@ -1 +0,0 @@
tiffutil -cathidpicheck background.png background@2x.png -out background.tiff

View File

@ -0,0 +1,177 @@
Param(
[Switch]$Help = $(if (Test-Path variable:Help) { $Help }),
[Switch]$Quiet = $(if (Test-Path variable:Quiet) { $Quiet }),
[Switch]$Verbose = $(if (Test-Path variable:Verbose) { $Verbose }),
[ValidateSet("32-bit", "64-bit")]
[String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" } else { (Get-CimInstance CIM_OperatingSystem).OSArchitecture })
)
##############################################################################
# Windows dependency management function
##############################################################################
#
# This script file can be included in build scripts for Windows or run
# directly
#
##############################################################################
$ErrorActionPreference = "Stop"
Function Install-obs-deps {
Param(
[Parameter(Mandatory=$true)]
[String]$Version
)
Write-Status "Setup for pre-built Windows OBS dependencies v${Version}"
Ensure-Directory $DepsBuildDir
$ArchSuffix = "$(if ($BuildArch -eq "64-bit") { "x64" } else { "x86" })"
if (!(Test-Path "${DepsBuildDir}/windows-deps-${Version}-${ArchSuffix}")) {
Write-Step "Download..."
$ProgressPreference = $(if ($Quiet.isPresent) { "SilentlyContinue" } else { "Continue" })
Invoke-WebRequest -Uri "https://github.com/obsproject/obs-deps/releases/download/win-${Version}/windows-deps-${Version}-${ArchSuffix}.zip" -UseBasicParsing -OutFile "windows-deps-${Version}-${ArchSuffix}.zip"
$ProgressPreference = "Continue"
Write-Step "Unpack..."
Expand-Archive -Path "windows-deps-${Version}-${ArchSuffix}.zip" -DestinationPath "${DepsBuildDir}/windows-deps-${Version}-${ArchSuffix}" -Force
} else {
Write-Step "Found existing pre-built dependencies..."
}
}
function Install-qt-deps {
Param(
[Parameter(Mandatory=$true)]
[String]$Version
)
Write-Status "Setup for pre-built dependency Qt v${Version}"
Ensure-Directory $DepsBuildDir
$ArchSuffix = "$(if ($BuildArch -eq "64-bit") { "x64" } else { "x86" })"
if (!(Test-Path "${DepsBuildDir}/windows-deps-${Version}-${ArchSuffix}/mkspecs")) {
Write-Step "Download..."
$ProgressPreference = $(if ($Quiet.isPresent) { 'SilentlyContinue' } else { 'Continue' })
Invoke-WebRequest -Uri "https://cdn-fastly.obsproject.com/downloads/windows-deps-qt-${Version}-${ArchSuffix}.zip" -UseBasicParsing -OutFile "windows-deps-qt-${Version}-${ArchSuffix}.zip"
$ProgressPreference = "Continue"
Write-Step "Unpack..."
Expand-Archive -Path "windows-deps-qt-${Version}-${ArchSuffix}.zip" -DestinationPath "${DepsBuildDir}/windows-deps-${Version}-${ArchSuffix}" -Force
} else {
Write-Step "Found existing pre-built Qt..."
}
}
function Install-vlc {
Param(
[Parameter(Mandatory=$true)]
[String]$Version
)
Write-Status "Setup for dependency VLC v${Version}"
Ensure-Directory $DepsBuildDir
if (!((Test-Path "$DepsBuildDir/vlc-${Version}") -and (Test-Path "$DepsBuildDir/vlc-${Version}/include/vlc/vlc.h"))) {
Write-Step "Download..."
$ProgressPreference = $(if ($Quiet.isPresent) { 'SilentlyContinue' } else { 'Continue' })
Invoke-WebRequest -Uri "https://cdn-fastly.obsproject.com/downloads/vlc.zip" -UseBasicParsing -OutFile "vlc_${Version}.zip"
$ProgressPreference = "Continue"
Write-Step "Unpack..."
# Expand-Archive -Path "vlc_${Version}.zip"
Invoke-Expression "7z x vlc_${Version}.zip -ovlc"
Move-Item -Path vlc -Destination "vlc-${Version}"
} else {
Write-Step "Found existing VLC..."
}
}
function Install-cef {
Param(
[Parameter(Mandatory=$true)]
[String]$Version
)
Write-Status "Setup for dependency CEF v${Version} - ${BuildArch}"
Ensure-Directory $DepsBuildDir
$ArchSuffix = "$(if ($BuildArch -eq "64-bit") { "x64" } else { "x86" })"
if (!((Test-Path "${DepsBuildDir}/cef_binary_${Version}_windows_${ArchSuffix}") -and (Test-Path "${DepsBuildDir}/cef_binary_${Version}_windows_${ArchSuffix}/build/libcef_dll_wrapper/Release/libcef_dll_wrapper.lib"))) {
Write-Step "Download..."
$ProgressPreference = $(if ($Quiet.isPresent) { 'SilentlyContinue' } else { 'Continue' })
Invoke-WebRequest -Uri "https://cdn-fastly.obsproject.com/downloads/cef_binary_${Version}_windows_${ArchSuffix}.zip" -UseBasicParsing -OutFile "cef_binary_${Version}_windows_${ArchSuffix}.zip"
$ProgressPreference = "Continue"
Write-Step "Unpack..."
Expand-Archive -Path "cef_binary_${Version}_windows_${ArchSuffix}.zip" -Force
} else {
Write-Step "Found existing CEF framework and loader library..."
}
}
function Install-Dependencies {
Param(
[String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" })
)
Install-Windows-Dependencies
$BuildDependencies = @(
@('obs-deps', $WindowsDepsVersion),
@('qt-deps', $WindowsDepsVersion),
@('vlc', $WindowsVlcVersion),
@('cef', $WindowsCefVersion)
)
Foreach($Dependency in ${BuildDependencies}) {
$DependencyName = $Dependency[0]
$DependencyVersion = $Dependency[1]
$FunctionName = "Install-${DependencyName}"
Invoke-Expression "${FunctionName} -Version ${DependencyVersion}"
}
Ensure-Directory ${CheckoutDir}
}
function Install-Dependencies-Standalone {
$ProductName = "OBS-Studio"
$CheckoutDir = Resolve-Path -Path "$PSScriptRoot\..\.."
$DepsBuildDir = "${CheckoutDir}/../obs-build-dependencies"
$ObsBuildDir = "${CheckoutDir}/../obs-studio"
. ${CheckoutDir}/CI/include/build_support_windows.ps1
Write-Status "Setup of OBS build dependencies"
Install-Dependencies
}
function Print-Usage {
$Lines = @(
"Usage: ${_ScriptName}",
"-Help : Print this help",
"-Quiet : Suppress most build process output",
"-Verbose : Enable more verbose build process output",
"-Choco : Enable automatic dependency installation via Chocolatey - Default: off"
"-BuildArch : Build architecture to use (32-bit or 64-bit) - Default: local architecture"
)
$Lines | Write-Host
}
if(!(Test-Path variable:_RunObsBuildScript)) {
$_ScriptName = "$($MyInvocation.MyCommand.Name)"
if($Help.isPresent) {
Print-Usage
exit 0
}
Install-Dependencies-Standalone
}

130
CI/windows/02_build_obs.ps1 Normal file
View File

@ -0,0 +1,130 @@
Param(
[Switch]$Help = $(if (Test-Path variable:Help) { $Help }),
[Switch]$Quiet = $(if (Test-Path variable:Quiet) { $Quiet }),
[Switch]$Verbose = $(if (Test-Path variable:Verbose) { $Verbose }),
[String]$BuildDirectory = $(if (Test-Path variable:BuildDirectory) { "${BuildDirectory}" } else { "build" }),
[ValidateSet("32-bit", "64-bit")]
[String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" } else { (Get-CimInstance CIM_OperatingSystem).OSArchitecture }),
[ValidateSet("Release", "RelWithDebInfo", "MinSizeRel", "Debug")]
[String]$BuildConfiguration = $(if (Test-Path variable:BuildConfiguration) { "${BuildConfiguration}" } else { "RelWithDebInfo" })
)
##############################################################################
# Windows libobs library build function
##############################################################################
#
# This script file can be included in build scripts for Windows or run
# directly
#
##############################################################################
$ErrorActionPreference = "Stop"
function Build-OBS {
Param(
[String]$BuildDirectory = $(if (Test-Path variable:BuildDirectory) { "${BuildDirectory}" }),
[String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" }),
[String]$BuildConfiguration = $(if (Test-Path variable:BuildConfiguration) { "${BuildConfiguration}" })
)
$NumProcessors = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
if ( $NumProcessors -gt 1 ) {
$env:UseMultiToolTask = $true
$env:EnforceProcessCountAcrossBuilds = $true
}
Write-Status "Build OBS"
Configure-OBS
Ensure-Directory ${CheckoutDir}
Write-Step "Build OBS targets..."
Invoke-Expression "cmake --build $(if($BuildArch -eq "64-bit") { "build64" } else { "build32" }) --config ${BuildConfiguration}"
}
function Configure-OBS {
Ensure-Directory ${CheckoutDir}
Write-Status "Configuration of OBS build system..."
$NumProcessors = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
if ( $NumProcessors -gt 1 ) {
$env:UseMultiToolTask = $true
$env:EnforceProcessCountAcrossBuilds = $true
}
# TODO: Clean up archive and directory naming across dependencies
$CmakePrefixPath = Resolve-Path -Path "${CheckoutDir}/../obs-build-dependencies/windows-deps-${WindowsDepsVersion}-$(if (${BuildArch} -eq "64-bit") { "x64" } else { "x86" })"
$CefDirectory = Resolve-Path -Path "${CheckoutDir}/../obs-build-dependencies/cef_binary_${WindowsCefVersion}_windows_$(if (${BuildArch} -eq "64-bit") { "x64" } else { "x86" })"
$BuildDirectoryActual = "${BuildDirectory}$(if (${BuildArch} -eq "64-bit") { "64" } else { "32" })"
$GeneratorPlatform = "$(if (${BuildArch} -eq "64-bit") { "x64" } else { "Win32" })"
$CmakeCommand = @(
"-S . -B `"${BuildDirectoryActual}`"",
"-G `"${CmakeGenerator}`"",
"-DCMAKE_GENERATOR_PLATFORM=`"${GeneratorPlatform}`"",
"-DCMAKE_SYSTEM_VERSION=`"${CmakeSystemVersion}`"",
"-DCMAKE_PREFIX_PATH:PATH=`"${CmakePrefixPath}`"",
"-DCEF_ROOT_DIR:PATH=`"${CefDirectory}`"",
"-DENABLE_BROWSER=ON",
"-DVLC_PATH:PATH=`"${CheckoutDir}/../obs-build-dependencies/vlc-${WindowsVlcVersion}`"",
"-DENABLE_VLC=ON",
"-DCMAKE_INSTALL_PREFIX=`"${BuildDirectoryActual}/install`"",
"-DVIRTUALCAM_GUID=`"${Env:VIRTUALCAM-GUID}`"",
"-DTWITCH_CLIENTID=`"${Env:TWITCH_CLIENTID}`"",
"-DTWITCH_HASH=`"${Env:TWITCH_HASH}`"",
"-DRESTREAM_CLIENTID=`"${Env:RESTREAM_CLIENTID}`"",
"-DRESTREAM_HASH=`"${Env:RESTREAM_HASH}`"",
"-DYOUTUBE_CLIENTID=`"${Env:YOUTUBE_CLIENTID}`"",
"-DYOUTUBE_CLIENTID_HASH=`"${Env:YOUTUBE_CLIENTID_HASH}`"",
"-DYOUTUBE_SECRET=`"${Env:YOUTUBE_SECRET}`"",
"-DYOUTUBE_SECRET_HASH=`"${Env:YOUTUBE_SECRET_HASH}`"",
"-DCOPIED_DEPENDENCIES=OFF",
"-DCOPY_DEPENDENCIES=ON",
"-DBUILD_FOR_DISTRIBUTION=`"$(if (Test-Path Env:BUILD_FOR_DISTRIBUTION) { "ON" } else { "OFF" })`"",
"$(if (Test-Path Env:CI) { "-DOBS_BUILD_NUMBER=${Env:GITHUB_RUN_ID}" })",
"$(if (Test-Path Variable:$Quiet) { "-Wno-deprecated -Wno-dev --log-level=ERROR" })"
)
Invoke-Expression "cmake ${CmakeCommand}"
Ensure-Directory ${CheckoutDir}
}
function Build-OBS-Standalone {
$ProductName = "OBS-Studio"
$CheckoutDir = Resolve-Path -Path "$PSScriptRoot\..\.."
$DepsBuildDir = "${CheckoutDir}/../obs-build-dependencies"
$ObsBuildDir = "${CheckoutDir}/../obs-studio"
. ${CheckoutDir}/CI/include/build_support_windows.ps1
Build-OBS
}
function Print-Usage {
$Lines = @(
"Usage: ${_ScriptName}",
"-Help : Print this help",
"-Quiet : Suppress most build process output",
"-Verbose : Enable more verbose build process output",
"-BuildDirectory : Directory to use for builds - Default: build64 on 64-bit systems, build32 on 32-bit systems",
"-BuildArch : Build architecture to use (32-bit or 64-bit) - Default: local architecture",
"-BuildConfiguration : Build configuration to use - Default: RelWithDebInfo"
)
$Lines | Write-Host
}
if(!(Test-Path variable:_RunObsBuildScript)) {
$_ScriptName = "$($MyInvocation.MyCommand.Name)"
if($Help.isPresent) {
Print-Usage
exit 0
}
Build-OBS-Standalone
}

View File

@ -0,0 +1,155 @@
Param(
[Switch]$Help = $(if (Test-Path variable:Help) { $Help }),
[Switch]$Quiet = $(if (Test-Path variable:Quiet) { $Quiet }),
[Switch]$Verbose = $(if (Test-Path variable:Verbose) { $Verbose }),
[Switch]$BuildInstaller = $(if ($BuildInstaller.isPresent) { $BuildInstaller }),
[Switch]$CombinedArchs = $(if ($CombinedArchs.isPresent) { $CombinedArchs }),
[String]$BuildDirectory = $(if (Test-Path variable:BuildDirectory) { "${BuildDirectory}" } else { "build" }),
[ValidateSet("32-bit", "64-bit")]
[String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" } else { (Get-CimInstance CIM_OperatingSystem).OSArchitecture }),
[ValidateSet("Release", "RelWithDebInfo", "MinSizeRel", "Debug")]
[String]$BuildConfiguration = $(if (Test-Path variable:BuildConfiguration) { "${BuildConfiguration}" } else { "RelWithDebInfo" })
)
##############################################################################
# Windows OBS package function
##############################################################################
#
# This script file can be included in build scripts for Windows or run
# directly
#
##############################################################################
$ErrorActionPreference = "Stop"
function Package-OBS {
Param(
[String]$BuildDirectory = $(if (Test-Path variable:BuildDirectory) { "${BuildDirectory}" }),
[String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" }),
[String]$BuildConfiguration = $(if (Test-Path variable:BuildConfiguration) { "${BuildConfiguration}" })
)
Write-Status "Package plugin ${ProductName}"
Ensure-Directory ${CheckoutDir}
if ($CombinedArchs.isPresent) {
if (!(Test-Path env:obsInstallerTempDir)) {
$Env:obsInstallerTempDir = "${CheckoutDir}/install_temp"
}
if (!(Test-Path ${CheckoutDir}/install_temp/bin/64bit)) {
Write-Step "Build 64-bit OBS..."
Invoke-Expression "cmake -S . -B `"${BuildDirectory}64`" -DCOPIED_DEPENDENCIES=OFF -DCOPY_DEPENDENCIES=ON"
Invoke-Expression "cmake --build `"${BuildDirectory}64`" --config `"${BuildConfiguration}`""
}
if (!(Test-Path ${CheckoutDir}/install_temp/bin/32bit)) {
Write-Step "Build 32-bit OBS..."
Invoke-Expression "cmake -S . -B `"${BuildDirectory}32`" -DCOPIED_DEPENDENCIES=OFF -DCOPY_DEPENDENCIES=ON"
Invoke-Expression "cmake --build `"${BuildDirectory}32`" --config `"${BuildConfiguration}`""
}
Write-Step "Prepare Installer run..."
Invoke-Expression "cmake -S . -B build -DINSTALLER_RUN=ON -DCMAKE_INSTALL_PREFIX=`"${CheckoutDir}/build/install`""
Write-Step "Execute Installer run..."
Invoke-Expression "cmake --build build --config `"${BuildConfiguration}`" -t install"
$CompressVars = @{
Path = "${CheckoutDir}/build/install/*"
CompressionLevel = "Optimal"
DestinationPath = "${FileName}-Windows.zip"
}
Write-Step "Creating zip archive..."
$ProgressPreference = $(if ($Quiet.isPresent) { 'SilentlyContinue' } else { 'Continue' })
Compress-Archive -Force @CompressVars
$ProgressPreference = 'Continue'
} elseif ($BuildArch -eq "64-bit") {
Write-Step "Install 64-bit OBS..."
Invoke-Expression "cmake --build `"${BuildDirectory}64`" --config ${BuildConfiguration} -t install"
$CompressVars = @{
Path = "${CheckoutDir}/build64/install/bin", "${CheckoutDir}/build64/install/data", "${CheckoutDir}/build64/install/obs-plugins"
CompressionLevel = "Optimal"
DestinationPath = "${FileName}-Win64.zip"
}
Write-Step "Creating zip archive..."
$ProgressPreference = $(if ($Quiet.isPresent) { 'SilentlyContinue' } else { 'Continue' })
Compress-Archive -Force @CompressVars
$ProgressPreference = 'Continue'
} elseif ($BuildArch -eq "32-bit") {
Write-Step "Install 32-bit OBS..."
Invoke-Expression "cmake --build `"${BuildDirectory}32`" --config ${BuildConfiguration} -t install"
$CompressVars = @{
Path = "${CheckoutDir}/build32/install/bin", "${CheckoutDir}/build32/install/data", "${CheckoutDir}/build32/install/obs-plugins"
CompressionLevel = "Optimal"
DestinationPath = "${FileName}-Win32.zip"
}
Write-Step "Creating zip archive..."
$ProgressPreference = $(if ($Quiet.isPresent) { 'SilentlyContinue' } else { 'Continue' })
Compress-Archive -Force @CompressVars
$ProgressPreference = 'Continue'
}
}
function Package-OBS-Standalone {
$ProductName = "OBS-Studio"
$CheckoutDir = Resolve-Path -Path "$PSScriptRoot\..\.."
. ${CheckoutDir}/CI/include/build_support_windows.ps1
Write-Step "Fetch OBS tags..."
$null = git fetch origin --tags
Ensure-Directory ${CheckoutDir}
$GitBranch = git rev-parse --abbrev-ref HEAD
$GitHash = git rev-parse --short HEAD
$ErrorActionPreference = "SilentlyContinue"
$GitTag = git describe --tags --abbrev=0
$ErrorActionPreference = "Stop"
if(Test-Path variable:BUILD_FOR_DISTRIBUTION) {
$VersionString = "${GitTag}"
} else {
$VersionString = "${GitTag}-${GitHash}"
}
$FileName = "${ProductName}-${VersionString}"
Package-OBS
}
function Print-Usage {
$Lines = @(
"Usage: ${_ScriptName}",
"-Help : Print this help",
"-Quiet : Suppress most build process output",
"-Verbose : Enable more verbose build process output",
"-CombinedArchs : Create combined architecture package",
"-BuildDirectory : Directory to use for builds - Default: build64 on 64-bit systems, build32 on 32-bit systems",
"-BuildArch : Build architecture to use (32-bit or 64-bit) - Default: local architecture",
"-BuildConfiguration : Build configuration to use - Default: RelWithDebInfo"
)
$Lines | Write-Host
}
if(!(Test-Path variable:_RunObsBuildScript)) {
$_ScriptName = "$($MyInvocation.MyCommand.Name)"
if($Help.isPresent) {
Print-Usage
exit 0
}
Package-OBS-Standalone
}

View File

@ -1,309 +1,92 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.16...3.21)
if (UNIX AND POLICY CMP0072)
# In case of both legacy and glvnd OpenGL libraries found. Prefer GLVND
cmake_policy(SET CMP0072 NEW)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules")
include(VersionConfig)
# Prohibit in-source builds
if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
message(
FATAL_ERROR
"OBS: You cannot build in a source directory (or any directory with "
"CMakeLists.txt file). Please make a build subdirectory. Feel free to "
"remove CMakeCache.txt and CMakeFiles.")
endif()
project(obs-studio)
option(DEBUG_FFMPEG_MUX "Debug FFmpeg muxer subprocess" FALSE)
project(obs-studio VERSION ${OBS_VERSION_CANONICAL})
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(WIN32)
cmake_minimum_required(VERSION 3.16)
# Check for Win SDK version 10.0.20348 or above
if(MSVC)
message(STATUS "Windows API version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
string(REPLACE "." ";" WINAPI_VER "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
list(GET WINAPI_VER 0 WINAPI_VER_MAJOR)
list(GET WINAPI_VER 1 WINAPI_VER_MINOR)
list(GET WINAPI_VER 2 WINAPI_VER_BUILD)
set(WINAPI_COMPATIBLE FALSE)
if(WINAPI_VER_MAJOR EQUAL 10)
if (WINAPI_VER_MINOR EQUAL 0)
if (WINAPI_VER_BUILD GREATER_EQUAL 20348)
set(WINAPI_COMPATIBLE TRUE)
endif()
else()
set(WINAPI_COMPATIBLE TRUE)
endif()
elseif(WINAPI_VER_MAJOR GREATER 10)
set(WINAPI_COMPATIBLE TRUE)
endif()
if(NOT WINAPI_COMPATIBLE)
message(FATAL_ERROR "OBS requires Windows 10 SDK version 10.0.20348.0 and above to compile.\nPlease download the most recent Windows 10 SDK in order to compile.")
endif()
endif()
if (QTDIR OR DEFINED ENV{QTDIR} OR DEFINED ENV{QTDIR32} OR DEFINED ENV{QTDIR64})
# Qt path set by user or env var
else()
set(QTDIR "" CACHE PATH "Path to Qt (e.g. C:/Qt/5.7/msvc2015_64)")
message(WARNING "QTDIR variable is missing. Please set this variable to specify path to Qt (e.g. C:/Qt/5.7/msvc2015_64)")
endif()
if (DepsPath OR DEFINED ENV{DepsPath} OR DEFINED ENV{DepsPath32} OR DEFINED ENV{DepsPath64})
# Dependencies path set by user or env var
else()
set(DepsPath "" CACHE PATH "Path to compiled dependencies (e.g. D:/dependencies/win64)")
message(WARNING "DepsPath variable is missing. Please set this variable to specify path to compiled dependencies (e.g. D:/dependencies/win64)")
endif()
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(ENABLE_SCRIPTING TRUE CACHE BOOL "Enables scripting")
set(SCRIPTING_ENABLED OFF CACHE BOOL "Internal global cmake variable" FORCE)
# Use target folders for MSVC/Xcode/etc.
include(DeprecationHelpers)
include(ObsHelpers)
include(ObsCpack)
include(GNUInstallDirs)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
set(OBS_RELEASE_CANDIDATE_MAJOR 0)
set(OBS_RELEASE_CANDIDATE_MINOR 0)
set(OBS_RELEASE_CANDIDATE_PATCH 0)
set(OBS_RELEASE_CANDIDATE 0)
set(OBS_BETA_MAJOR 0)
set(OBS_BETA_MINOR 0)
set(OBS_BETA_PATCH 0)
set(OBS_BETA 0)
# Must be a string in the format of "x.x.x-rcx" or "x.x.x-betax"
if(DEFINED RELEASE_CANDIDATE)
set(OBS_VERSION "${RELEASE_CANDIDATE}")
string(REPLACE "-rc" "." RC_SPLIT ${RELEASE_CANDIDATE})
string(REPLACE "." ";" RC_SPLIT ${RC_SPLIT})
message(WARNING "******************************************************************************\nRelease candidate detected, OBS_VERSION is now: ${OBS_VERSION}\n******************************************************************************")
list(GET RC_SPLIT 0 OBS_RELEASE_CANDIDATE_MAJOR)
list(GET RC_SPLIT 1 OBS_RELEASE_CANDIDATE_MINOR)
list(GET RC_SPLIT 2 OBS_RELEASE_CANDIDATE_PATCH)
list(GET RC_SPLIT 3 OBS_RELEASE_CANDIDATE)
elseif(DEFINED BETA)
set(OBS_VERSION "${BETA}")
string(REPLACE "-beta" "." BETA_SPLIT ${BETA})
string(REPLACE "." ";" BETA_SPLIT ${BETA_SPLIT})
message(WARNING "******************************************************************************\nBeta detected, OBS_VERSION is now: ${OBS_VERSION}\n******************************************************************************")
list(GET BETA_SPLIT 0 OBS_BETA_MAJOR)
list(GET BETA_SPLIT 1 OBS_BETA_MINOR)
list(GET BETA_SPLIT 2 OBS_BETA_PATCH)
list(GET BETA_SPLIT 3 OBS_BETA)
endif()
# Binary Versioning for Windows
if(WIN32)
string(REPLACE "-" ";" UI_VERSION_SPLIT ${OBS_VERSION})
list(GET UI_VERSION_SPLIT 0 UI_VERSION)
string(REPLACE "." ";" UI_VERSION_SEMANTIC ${UI_VERSION})
list(GET UI_VERSION_SEMANTIC 0 UI_VERSION_MAJOR)
list(GET UI_VERSION_SEMANTIC 1 UI_VERSION_MINOR)
list(GET UI_VERSION_SEMANTIC 2 UI_VERSION_PATCH)
set(OBS_COMPANY_NAME "OBS")
set(OBS_PRODUCT_NAME "OBS Studio")
set(OBS_COMMENTS "Free and open source software for video recording and live streaming")
set(OBS_LEGAL_COPYRIGHT "(C) Hugh Bailey")
set(MODULE_DESCRIPTION "OBS Studio")
configure_file(UI/obs.rc.in ${PROJECT_BINARY_DIR}/obs.rc)
endif()
if(MSVC AND NOT EXISTS "${CMAKE_BINARY_DIR}/ALL_BUILD.vcxproj.user")
file(GENERATE
OUTPUT "${CMAKE_BINARY_DIR}/ALL_BUILD.vcxproj.user"
INPUT "${CMAKE_SOURCE_DIR}/cmake/ALL_BUILD.vcxproj.user.in")
endif()
# Set default compiler flags
include(CompilerConfig)
# Allow selection of common build types via UI
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
set(CMAKE_BUILD_TYPE
"RelWithDebInfo"
CACHE STRING
"OBS build type [Release, RelWithDebInfo, Debug, MinSizeRel]" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Release RelWithDebInfo
Debug MinSizeRel)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
# Global project options
option(BUILD_FOR_DISTRIBUTION "Build for distribution (enables optimisations)"
OFF)
option(ENABLE_UI "Enable building with UI (requires Qt)" ON)
option(ENABLE_SCRIPTING "Enable scripting support" ON)
option(USE_LIBCXX "Use libc++ instead of libstdc++" ${APPLE})
option(
BUILD_TESTS
"Build test directory (includes test sources and possibly a platform test executable)"
OFF)
if(${CMAKE_C_COMPILER_ID} MATCHES "Clang" OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
set(CMAKE_COMPILER_IS_CLANG TRUE)
if(OS_WINDOWS)
option(
INSTALLER_RUN
"Build a multiarch installer (needs to run independently after both archs have compiled) (Windows)"
OFF)
elseif(OS_MACOS)
option(ENABLE_SPARKLE_UPDATER "Enable Sparkle framework for updates (macOS)"
OFF)
elseif(OS_POSIX)
option(LINUX_PORTABLE "Build portable version (Linux)" OFF)
option(USE_XDG "Utilize XDG Base Directory Specification (Linux)" ON)
if(OS_LINUX)
option(ENABLE_WAYLAND "Enable building with support for Wayland (Linux)" ON)
option(BUILD_FOR_PPA "Build for PPA distribution" OFF)
endif()
endif()
if (MSVC_CXX_ARCHITECTURE_ID)
string(TOLOWER ${MSVC_CXX_ARCHITECTURE_ID} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
else ()
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
endif ()
setup_obs_project()
mark_as_advanced(BUILD_TESTS USE_LIBCXX)
if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86|x64|x86_64|amd64|e2k)")
if(NOT MSVC)
set(ARCH_SIMD_FLAGS "-mmmx" "-msse" "-msse2")
endif()
elseif(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64(le)?")
set(ARCH_SIMD_DEFINES "-DNO_WARN_X86_INTRINSICS")
set(ARCH_SIMD_FLAGS "-mvsx")
add_compile_definitions(NO_WARN_X86_INTRINSICS)
else()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSIMDE_ENABLE_OPENMP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSIMDE_ENABLE_OPENMP")
CHECK_C_COMPILER_FLAG("-fopenmp-simd" C_COMPILER_SUPPORTS_OPENMP_SIMD)
if(C_COMPILER_SUPPORTS_OPENMP_SIMD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp-simd")
endif()
CHECK_CXX_COMPILER_FLAG("-fopenmp-simd" CXX_COMPILER_SUPPORTS_OPENMP_SIMD)
if(CXX_COMPILER_SUPPORTS_OPENMP_SIMD)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp-simd")
endif()
endif()
set(ARCH_SIMD_FLAGS "")
message(STATUS "No Native SSE2 SIMD Support - Using SIMDE")
if(INSTALLER_RUN)
generate_multiarch_installer()
return()
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wvla -Wno-unused-function -Wno-missing-field-initializers ${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
set(CMAKE_C_FLAGS "-Wall -Wextra -Wvla -Wno-unused-function -Werror-implicit-function-declaration -Wno-missing-braces -Wno-missing-field-initializers ${CMAKE_C_FLAGS} -std=gnu99 -fno-strict-aliasing")
# OBS sources and plugins
add_subdirectory(deps)
add_subdirectory(libobs-opengl)
if(OS_WINDOWS)
add_subdirectory(libobs-d3d11)
add_subdirectory(libobs-winrt)
endif()
add_subdirectory(libobs)
add_subdirectory(plugins)
option(USE_LIBC++ "Use libc++ instead of libstdc++" ${APPLE})
if(USE_LIBC++)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
elseif(MSVC)
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
# OBS main app
add_subdirectory(UI)
# Disable pointless constant condition warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4127 /wd4201 /wd4456 /wd4457 /wd4458 /wd4459 /wd4595")
# Tests
if(ENABLE_UNIT_TESTS)
enable_testing()
endif()
if(WIN32)
add_definitions(-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
if(BUILD_TESTS OR ENABLE_UNIT_TESTS)
add_subdirectory(test)
endif()
if(MSVC)
add_compile_options("/MP")
set(CMAKE_C_FLAGS_DEBUG "/DDEBUG=1 /D_DEBUG=1 ${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_DEBUG "/DDEBUG=1 /D_DEBUG=1 ${CMAKE_C_FLAGS_DEBUG}")
# https://gitlab.kitware.com/cmake/cmake/-/issues/20812
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /Ob2")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Ob2")
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
endif()
foreach(t EXE SHARED MODULE)
set(CMAKE_${t}_LINKER_FLAGS "${CMAKE_${t}_LINKER_FLAGS} /OPT:REF")
set(CMAKE_${t}_LINKER_FLAGS_DEBUG "${CMAKE_${t}_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO")
set(CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO} /INCREMENTAL:NO /OPT:ICF")
endforeach()
else()
if(MINGW)
set(CMAKE_WIDL "widl" CACHE STRING "wine IDL header file generation program")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WIN32_WINNT=0x0600 -DWINVER=0x0600")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0600 -DWINVER=0x0600")
endif()
set(CMAKE_C_FLAGS_DEBUG "-DDEBUG=1 -D_DEBUG=1 ${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG=1 -D_DEBUG=1 ${CMAKE_C_FLAGS_DEBUG}")
endif()
if(APPLE)
set(CMAKE_MACOSX_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
list(APPEND CMAKE_INSTALL_RPATH "@loader_path/" "@executable_path/")
elseif(UNIX)
option(USE_XDG "Utilize XDG Base Directory Specification" ON)
option(ENABLE_WAYLAND "Build support for Wayland" ON)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
option(ENABLE_DARRAY_TYPE_TEST "Test types of darray argument" ON)
else()
option(ENABLE_DARRAY_TYPE_TEST "Test types of darray argument" OFF)
endif()
if(USE_XDG)
add_definitions(-DUSE_XDG)
endif()
if(NOT UNIX_STRUCTURE)
list(APPEND CMAKE_INSTALL_RPATH "$ORIGIN")
endif()
if(ENABLE_DARRAY_TYPE_TEST)
add_definitions(-DENABLE_DARRAY_TYPE_TEST)
endif()
endif()
if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "e2k")
foreach(TEST_C_FLAG "-Wno-unused-parameter" "-Wno-ignored-qualifiers" "-Wno-pointer-sign" "-Wno-unused-variable" "-Wno-sign-compare" "-Wno-bad-return-value-type" "-Wno-maybe-uninitialized")
CHECK_C_COMPILER_FLAG(${TEST_C_FLAG} C_COMPILER_SUPPORTS_FLAG_${TEST_C_FLAG})
if(C_COMPILER_SUPPORTS_FLAG_${TEST_C_FLAG})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TEST_C_FLAG}")
endif()
endforeach()
foreach(TEST_CXX_FLAG "-Wno-invalid-offsetof" "-Wno-maybe-uninitialized")
CHECK_CXX_COMPILER_FLAG(${TEST_CXX_FLAG} CXX_COMPILER_SUPPORTS_FLAG_${TEST_CXX_FLAG})
if(CXX_COMPILER_SUPPORTS_FLAG_${TEST_CXX_FLAG})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEST_CXX_FLAG}")
endif()
endforeach()
endif()
option(BUILD_TESTS "Build test directory (includes test sources and possibly a platform test executable)" FALSE)
mark_as_advanced(BUILD_TESTS)
if(NOT INSTALLER_RUN)
option(ENABLE_UI "Enables the OBS user interfaces" ON)
if(DISABLE_UI OR NOT ENABLE_UI)
set(UI_ENABLED FALSE)
else()
set(UI_ENABLED TRUE)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
endif()
if(DEFINED QTDIR${_lib_suffix})
list(APPEND CMAKE_PREFIX_PATH "${QTDIR${_lib_suffix}}")
elseif(DEFINED QTDIR)
list(APPEND CMAKE_PREFIX_PATH "${QTDIR}")
elseif(DEFINED ENV{QTDIR${_lib_suffix}})
list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR${_lib_suffix}}")
elseif(DEFINED ENV{QTDIR})
list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR}")
endif()
find_package(Qt5Widgets REQUIRED)
endif()
add_subdirectory(deps)
if(WIN32)
add_subdirectory(libobs-d3d11)
add_subdirectory(libobs-winrt)
endif()
add_subdirectory(libobs-opengl)
add_subdirectory(libobs)
add_subdirectory(plugins)
add_subdirectory(UI)
if (ENABLE_UNIT_TESTS)
enable_testing()
endif()
if (BUILD_TESTS OR ENABLE_UNIT_TESTS)
add_subdirectory(test)
endif()
else()
obs_generate_multiarch_installer()
endif()
include(CopyMSVCBins)

View File

@ -1,502 +1,413 @@
if(DISABLE_UI)
message(STATUS "UI disabled")
return()
elseif(ENABLE_UI)
set(FIND_MODE REQUIRED)
else()
set(FIND_MODE QUIET)
endif()
if(BROWSER_AVAILABLE_INTERNAL)
add_definitions(-DBROWSER_AVAILABLE)
endif()
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")
return()
endif()
if(NOT QT_VERSION)
set(QT_VERSION
"5"
CACHE STRING "OBS Qt version [5, 6]" FORCE)
set_property(CACHE QT_VERSION PROPERTY STRINGS 5 6)
endif()
project(obs)
set(DISABLE_UPDATE_MODULE TRUE CACHE BOOL "Disables building the update module")
# Legacy support
if(TARGET obs-browser
AND NOT TARGET OBS::browser-panels
AND BROWSER_PANEL_SUPPORT_ENABLED)
add_library(obs-browser-panels INTERFACE)
add_library(OBS::browser-panels ALIAS obs-browser-panels)
if(NOT DEFINED TWITCH_CLIENTID OR "${TWITCH_CLIENTID}" STREQUAL "" OR
NOT DEFINED TWITCH_HASH OR "${TWITCH_HASH}" STREQUAL "" OR
NOT BROWSER_AVAILABLE_INTERNAL)
set(TWITCH_ENABLED FALSE)
set(TWITCH_CLIENTID "")
set(TWITCH_HASH "0")
target_include_directories(
obs-browser-panels INTERFACE ${CMAKE_SOURCE_DIR}/plugins/obs-browser/panel)
endif()
if(NOT DEFINED TWITCH_CLIENTID
OR "${TWITCH_CLIENTID}" STREQUAL ""
OR NOT DEFINED TWITCH_HASH
OR "${TWITCH_HASH}" STREQUAL ""
OR NOT TARGET OBS::browser-panels)
set(TWITCH_ENABLED OFF)
set(TWITCH_CLIENTID "")
set(TWITCH_HASH "0")
else()
set(TWITCH_ENABLED TRUE)
set(TWITCH_ENABLED ON)
endif()
if(NOT DEFINED RESTREAM_CLIENTID OR "${RESTREAM_CLIENTID}" STREQUAL "" OR
NOT DEFINED RESTREAM_HASH OR "${RESTREAM_HASH}" STREQUAL "" OR
NOT BROWSER_AVAILABLE_INTERNAL)
set(RESTREAM_ENABLED FALSE)
set(RESTREAM_CLIENTID "")
set(RESTREAM_HASH "0")
if(NOT DEFINED RESTREAM_CLIENTID
OR "${RESTREAM_CLIENTID}" STREQUAL ""
OR NOT DEFINED RESTREAM_HASH
OR "${RESTREAM_HASH}" STREQUAL ""
OR NOT TARGET OBS::browser-panels)
set(RESTREAM_ENABLED OFF)
set(RESTREAM_CLIENTID "")
set(RESTREAM_HASH "0")
else()
set(RESTREAM_ENABLED TRUE)
set(RESTREAM_ENABLED ON)
endif()
if(DEFINED ENV{YOUTUBE_CLIENTID} AND NOT DEFINED YOUTUBE_CLIENTID)
set(YOUTUBE_CLIENTID "$ENV{YOUTUBE_CLIENTID}")
endif()
if(DEFINED ENV{YOUTUBE_CLIENTID_HASH} AND NOT DEFINED YOUTUBE_CLIENTID_HASH)
set(YOUTUBE_CLIENTID_HASH "$ENV{YOUTUBE_CLIENTID_HASH}")
endif()
if(DEFINED ENV{YOUTUBE_SECRET} AND NOT DEFINED YOUTUBE_SECRET)
set(YOUTUBE_SECRET "$ENV{YOUTUBE_SECRET}")
endif()
if(DEFINED ENV{YOUTUBE_SECRET_HASH} AND NOT DEFINED YOUTUBE_SECRET_HASH)
set(YOUTUBE_SECRET_HASH "$ENV{YOUTUBE_SECRET_HASH}")
endif()
if(NOT DEFINED YOUTUBE_CLIENTID OR "${YOUTUBE_CLIENTID}" STREQUAL "" OR
NOT DEFINED YOUTUBE_SECRET OR "${YOUTUBE_SECRET}" STREQUAL "" OR
NOT DEFINED YOUTUBE_CLIENTID_HASH OR "${YOUTUBE_CLIENTID_HASH}" STREQUAL "" OR
NOT DEFINED YOUTUBE_SECRET_HASH OR "${YOUTUBE_SECRET_HASH}" STREQUAL "")
set(YOUTUBE_ENABLED FALSE)
if(NOT DEFINED YOUTUBE_CLIENTID
OR "${YOUTUBE_CLIENTID}" STREQUAL ""
OR NOT DEFINED YOUTUBE_SECRET
OR "${YOUTUBE_SECRET}" STREQUAL ""
OR NOT DEFINED YOUTUBE_CLIENTID_HASH
OR "${YOUTUBE_CLIENTID_HASH}" STREQUAL ""
OR NOT DEFINED YOUTUBE_SECRET_HASH
OR "${YOUTUBE_SECRET_HASH}" STREQUAL "")
set(YOUTUBE_ENABLED OFF)
else()
set(YOUTUBE_ENABLED TRUE)
set(YOUTUBE_ENABLED ON)
endif()
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/ui-config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/ui-config.h")
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
set(CMAKE_AUTOMOC TRUE)
find_package(Threads REQUIRED)
find_package(Qt5Network ${FIND_MODE})
find_package(Qt5Widgets ${FIND_MODE})
find_package(Qt5Svg ${FIND_MODE})
if(WIN32 AND (Qt5Widgets_VERSION VERSION_LESS 6.0.0))
find_package(Qt5WinExtras ${FIND_MODE})
endif()
find_package(Qt5Xml ${FIND_MODE})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ui-config.h.in
${CMAKE_CURRENT_BINARY_DIR}/ui-config.h)
find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil avformat)
find_package(CURL REQUIRED)
if(NOT Qt5Widgets_FOUND)
if (ENABLE_UI)
message(FATAL_ERROR "Failed to find Qt5")
else()
message(STATUS "Qt5 not found - UI disabled")
return()
endif()
endif()
add_subdirectory(frontend-plugins)
add_executable(obs)
find_qt(
VERSION ${QT_VERSION}
COMPONENTS Widgets Network Svg Xml
COMPONENTS_WIN WinExtras
COMPONENTS_LINUX Gui)
include_directories(${FFMPEG_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(SYSTEM "obs-frontend-api")
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/deps/libff")
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/deps/json11")
if(BROWSER_AVAILABLE_INTERNAL)
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/plugins/obs-browser/panel")
endif()
target_link_libraries(obs PRIVATE Qt::Widgets Qt::Svg Qt::Xml Qt::Network)
find_package(Libcurl REQUIRED)
include_directories(${LIBCURL_INCLUDE_DIRS})
add_definitions(${LIBCURL_DEFINITIONS})
set_target_properties(
obs
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS "forms;forms/source-toolbar")
if(WIN32)
include_directories(${BLAKE2_INCLUDE_DIR})
target_include_directories(obs PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR})
set(obs_PLATFORM_SOURCES
platform-windows.cpp
win-update/update-window.cpp
win-update/win-update.cpp
win-update/win-update-helpers.cpp
${obs-studio_BINARY_DIR}/obs.rc)
set(obs_PLATFORM_HEADERS
win-update/update-window.hpp
win-update/win-update.hpp
win-update/win-update-helpers.hpp)
set(obs_PLATFORM_LIBRARIES
crypt32
blake2)
target_sources(obs PRIVATE forms/obs.qrc)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
endif()
elseif(APPLE)
set(obs_PLATFORM_SOURCES
platform-osx.mm)
target_sources(
obs
PRIVATE auth-oauth.cpp
auth-oauth.hpp
auth-listener.cpp
auth-listener.hpp
obf.c
obf.h
obs-app.cpp
obs-app.hpp
obs-proxy-style.cpp
obs-proxy-style.hpp
api-interface.cpp
auth-base.cpp
auth-base.hpp
crash-report.cpp
crash-report.hpp
display-helpers.hpp
platform.hpp
qt-display.cpp
qt-display.hpp
qt-wrappers.cpp
qt-wrappers.hpp
ui-validation.cpp
ui-validation.hpp
${CMAKE_SOURCE_DIR}/deps/json11/json11.cpp
${CMAKE_SOURCE_DIR}/deps/json11/json11.hpp
${CMAKE_SOURCE_DIR}/deps/libff/libff/ff-util.c
${CMAKE_SOURCE_DIR}/deps/libff/libff/ff-util.h
${CMAKE_CURRENT_BINARY_DIR}/ui-config.h)
find_package(AppKit REQUIRED)
set(obs_PLATFORM_LIBRARIES ${APPKIT_LIBRARIES})
target_sources(
obs
PRIVATE adv-audio-control.cpp
adv-audio-control.hpp
audio-encoders.cpp
audio-encoders.hpp
balance-slider.hpp
combobox-ignorewheel.cpp
combobox-ignorewheel.hpp
clickable-label.hpp
double-slider.cpp
double-slider.hpp
horizontal-scroll-area.cpp
horizontal-scroll-area.hpp
item-widget-helpers.cpp
item-widget-helpers.hpp
context-bar-controls.cpp
context-bar-controls.hpp
expand-checkbox.hpp
focus-list.cpp
focus-list.hpp
hotkey-edit.cpp
hotkey-edit.hpp
locked-checkbox.cpp
locked-checkbox.hpp
log-viewer.cpp
log-viewer.hpp
media-controls.cpp
media-controls.hpp
media-slider.cpp
media-slider.hpp
menu-button.cpp
menu-button.hpp
mute-checkbox.hpp
properties-view.cpp
properties-view.hpp
properties-view.moc.hpp
record-button.cpp
record-button.hpp
remote-text.cpp
remote-text.hpp
scene-tree.cpp
scene-tree.hpp
screenshot-obj.hpp
slider-absoluteset-style.cpp
slider-absoluteset-style.hpp
slider-ignorewheel.cpp
slider-ignorewheel.hpp
source-label.cpp
source-label.hpp
spinbox-ignorewheel.cpp
spinbox-ignorewheel.hpp
source-tree.cpp
source-tree.hpp
url-push-button.cpp
url-push-button.hpp
undo-stack-obs.cpp
undo-stack-obs.hpp
volume-control.cpp
volume-control.hpp
vertical-scroll-area.cpp
vertical-scroll-area.hpp
visibility-checkbox.cpp
visibility-checkbox.hpp
visibility-item-widget.cpp
visibility-item-widget.hpp)
add_definitions(-fobjc-arc)
target_sources(
obs
PRIVATE window-basic-about.cpp
window-basic-about.hpp
window-basic-auto-config.cpp
window-basic-auto-config.hpp
window-basic-auto-config-test.cpp
window-basic-adv-audio.cpp
window-basic-adv-audio.hpp
window-basic-filters.cpp
window-basic-filters.hpp
window-basic-interaction.cpp
window-basic-interaction.hpp
window-basic-main.cpp
window-basic-main.hpp
window-basic-main-browser.cpp
window-basic-main-dropfiles.cpp
window-basic-main-icons.cpp
window-basic-main-outputs.cpp
window-basic-main-outputs.hpp
window-basic-main-profiles.cpp
window-basic-main-scene-collections.cpp
window-basic-main-screenshot.cpp
window-basic-main-transitions.cpp
window-basic-preview.cpp
window-basic-properties.cpp
window-basic-properties.hpp
window-basic-settings.cpp
window-basic-settings.hpp
window-basic-settings-stream.cpp
window-basic-source-select.cpp
window-basic-source-select.hpp
window-basic-stats.cpp
window-basic-stats.hpp
window-basic-status-bar.cpp
window-basic-status-bar.hpp
window-basic-transform.cpp
window-basic-transform.hpp
window-basic-preview.hpp
window-dock.cpp
window-dock.hpp
window-importer.cpp
window-importer.hpp
window-log-reply.hpp
window-main.hpp
window-missing-files.cpp
window-missing-files.hpp
window-namedialog.cpp
window-namedialog.hpp
window-log-reply.cpp
window-projector.cpp
window-projector.hpp
window-remux.cpp
window-remux.hpp)
option(ENABLE_SPARKLE_UPDATER "Enables updates via the Sparkle framework (don't forget to update the Info.plist for your .app)" OFF)
if(ENABLE_SPARKLE_UPDATER)
find_library(SPARKLE Sparkle)
include_directories(${SPARKLE})
set(obs_PLATFORM_SOURCES
${obs_PLATFORM_SOURCES}
sparkle-updater.mm)
set(obs_PLATFORM_LIBRARIES
${obs_PLATFORM_LIBRARIES}
${SPARKLE})
add_definitions(-DUPDATE_SPARKLE=1)
endif()
target_sources(
obs
PRIVATE importers/importers.cpp importers/importers.hpp importers/classic.cpp
importers/sl.cpp importers/studio.cpp importers/xsplit.cpp)
elseif(UNIX)
find_package(Qt5Gui REQUIRED)
find_package(PythonDeps QUIET)
target_compile_features(obs PRIVATE cxx_std_17)
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
target_include_directories(obs PRIVATE ${CMAKE_SOURCE_DIR}/deps/json11
${CMAKE_SOURCE_DIR}/deps/libff)
set(obs_PLATFORM_SOURCES
platform-x11.cpp)
set(obs_PLATFORM_LIBRARIES
${obs_PLATFORM_LIBRARIES}
Qt5::Gui
Qt5::GuiPrivate)
if("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
list(APPEND obs_PLATFORM_LIBRARIES
procstat)
endif()
endif()
if(BROWSER_AVAILABLE_INTERNAL)
list(APPEND obs_PLATFORM_SOURCES
window-dock-browser.cpp
window-extra-browsers.cpp
)
list(APPEND obs_PLATFORM_HEADERS
window-dock-browser.hpp
window-extra-browsers.hpp
)
if(TWITCH_ENABLED)
list(APPEND obs_PLATFORM_SOURCES
auth-twitch.cpp
)
list(APPEND obs_PLATFORM_HEADERS
auth-twitch.hpp
)
endif()
if(RESTREAM_ENABLED)
list(APPEND obs_PLATFORM_SOURCES
auth-restream.cpp
)
list(APPEND obs_PLATFORM_HEADERS
auth-restream.hpp
)
endif()
endif()
if(YOUTUBE_ENABLED)
list(APPEND obs_PLATFORM_SOURCES
auth-youtube.cpp
youtube-api-wrappers.cpp
)
list(APPEND obs_PLATFORM_HEADERS
auth-youtube.hpp
youtube-api-wrappers.hpp
)
endif()
set(obs_libffutil_SOURCES
../deps/libff/libff/ff-util.c
)
set(obs_libffutil_HEADERS
../deps/libff/libff/ff-util.h
)
if(MSVC)
set_source_files_properties(
../deps/libff/libff/ff-util.c
PROPERTIES COMPILE_FLAGS -Dinline=__inline
)
set(obs_PLATFORM_LIBRARIES
${obs_PLATFORM_LIBRARIES}
w32-pthreads)
endif()
set(obs_SOURCES
${obs_PLATFORM_SOURCES}
${obs_libffutil_SOURCES}
../deps/json11/json11.cpp
obs-app.cpp
window-dock.cpp
api-interface.cpp
window-basic-main.cpp
window-basic-stats.cpp
window-basic-filters.cpp
window-basic-settings.cpp
window-basic-interaction.cpp
window-basic-properties.cpp
window-basic-auto-config.cpp
window-basic-main-outputs.cpp
window-basic-source-select.cpp
window-basic-settings-stream.cpp
window-basic-main-screenshot.cpp
window-basic-auto-config-test.cpp
window-basic-main-scene-collections.cpp
window-basic-main-transitions.cpp
window-basic-main-dropfiles.cpp
window-basic-main-profiles.cpp
window-basic-main-browser.cpp
window-basic-main-icons.cpp
window-basic-status-bar.cpp
window-basic-adv-audio.cpp
window-basic-transform.cpp
window-basic-preview.cpp
window-basic-about.cpp
window-importer.cpp
media-controls.cpp
window-namedialog.cpp
window-log-reply.cpp
window-projector.cpp
window-remux.cpp
window-missing-files.cpp
auth-base.cpp
auth-oauth.cpp
auth-listener.cpp
obf.c
source-tree.cpp
scene-tree.cpp
properties-view.cpp
focus-list.cpp
menu-button.cpp
double-slider.cpp
slider-ignorewheel.cpp
combobox-ignorewheel.cpp
spinbox-ignorewheel.cpp
record-button.cpp
ui-validation.cpp
url-push-button.cpp
volume-control.cpp
adv-audio-control.cpp
item-widget-helpers.cpp
context-bar-controls.cpp
horizontal-scroll-area.cpp
vertical-scroll-area.cpp
visibility-item-widget.cpp
slider-absoluteset-style.cpp
qt-display.cpp
crash-report.cpp
hotkey-edit.cpp
source-label.cpp
remote-text.cpp
audio-encoders.cpp
qt-wrappers.cpp
log-viewer.cpp
obs-proxy-style.cpp
locked-checkbox.cpp
visibility-checkbox.cpp
media-slider.cpp
undo-stack-obs.cpp)
set(obs_HEADERS
${obs_PLATFORM_HEADERS}
${obs_libffutil_HEADERS}
../deps/json11/json11.hpp
obs-app.hpp
platform.hpp
window-dock.hpp
window-main.hpp
window-basic-main.hpp
window-basic-stats.hpp
window-basic-filters.hpp
window-basic-settings.hpp
window-basic-interaction.hpp
window-basic-properties.hpp
window-basic-auto-config.hpp
window-basic-main-outputs.hpp
window-basic-source-select.hpp
window-basic-about.hpp
window-basic-status-bar.hpp
window-basic-adv-audio.hpp
window-basic-transform.hpp
window-basic-preview.hpp
window-importer.hpp
media-controls.hpp
window-namedialog.hpp
window-log-reply.hpp
window-projector.hpp
window-remux.hpp
window-missing-files.hpp
auth-base.hpp
auth-oauth.hpp
auth-listener.hpp
obf.h
source-tree.hpp
scene-tree.hpp
properties-view.hpp
properties-view.moc.hpp
display-helpers.hpp
balance-slider.hpp
double-slider.hpp
slider-ignorewheel.hpp
combobox-ignorewheel.hpp
spinbox-ignorewheel.hpp
focus-list.hpp
menu-button.hpp
mute-checkbox.hpp
record-button.hpp
ui-validation.hpp
screenshot-obj.hpp
url-push-button.hpp
volume-control.hpp
adv-audio-control.hpp
item-widget-helpers.hpp
visibility-checkbox.hpp
context-bar-controls.hpp
locked-checkbox.hpp
horizontal-scroll-area.hpp
expand-checkbox.hpp
vertical-scroll-area.hpp
visibility-item-widget.hpp
slider-absoluteset-style.hpp
qt-display.hpp
crash-report.hpp
hotkey-edit.hpp
source-label.hpp
remote-text.hpp
audio-encoders.hpp
qt-wrappers.hpp
clickable-label.hpp
log-viewer.hpp
obs-proxy-style.hpp
obs-proxy-style.hpp
media-slider.hpp
undo-stack-obs.hpp)
set(obs_importers_HEADERS
importers/importers.hpp)
set(obs_importers_SOURCES
importers/importers.cpp
importers/classic.cpp
importers/sl.cpp
importers/studio.cpp
importers/xsplit.cpp)
source_group("importers\\Source Files" FILES ${obs_importers_SOURCES})
source_group("importers\\Header Files" FILES ${obs_importers_HEADERS})
set(obs_UI
forms/source-toolbar/browser-source-toolbar.ui
forms/source-toolbar/device-select-toolbar.ui
forms/source-toolbar/game-capture-toolbar.ui
forms/source-toolbar/image-source-toolbar.ui
forms/source-toolbar/color-source-toolbar.ui
forms/source-toolbar/text-source-toolbar.ui
forms/source-toolbar/media-controls.ui
forms/AutoConfigStartPage.ui
forms/AutoConfigVideoPage.ui
forms/AutoConfigStreamPage.ui
forms/AutoConfigTestPage.ui
forms/ColorSelect.ui
forms/OBSLogReply.ui
forms/OBSBasic.ui
forms/OBSBasicTransform.ui
forms/OBSBasicFilters.ui
forms/OBSBasicSettings.ui
forms/OBSBasicSourceSelect.ui
forms/OBSBasicInteraction.ui
forms/OBSExtraBrowsers.ui
forms/OBSUpdate.ui
forms/OBSRemux.ui
forms/OBSImporter.ui
forms/OBSMissingFiles.ui
forms/OBSAbout.ui)
set(obs_QRC
forms/obs.qrc)
if(YOUTUBE_ENABLED)
list(APPEND obs_SOURCES
window-youtube-actions.cpp
)
list(APPEND obs_HEADERS
window-youtube-actions.hpp
)
list(APPEND obs_UI
forms/OBSYoutubeActions.ui
)
endif()
qt5_wrap_ui(obs_UI_HEADERS ${obs_UI})
qt5_add_resources(obs_QRC_SOURCES ${obs_QRC})
add_executable(obs WIN32
obs.manifest
${obs_SOURCES}
${obs_HEADERS}
${obs_importers_SOURCES}
${obs_importers_HEADERS}
${obs_UI_HEADERS}
${obs_QRC_SOURCES})
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_output_suffix "64")
else()
set(_output_suffix "32")
endif()
set_target_properties(obs
PROPERTIES
OUTPUT_NAME "obs${_output_suffix}")
if(Qt5Widgets_VERSION VERSION_LESS 6.0.0)
target_link_libraries(obs
Qt5::WinExtras)
endif()
endif()
target_link_libraries(obs
libobs
Threads::Threads
Qt5::Network
Qt5::Widgets
Qt5::Svg
Qt5::Xml
obs-frontend-api
${FFMPEG_LIBRARIES}
${LIBCURL_LIBRARIES}
${obs_PLATFORM_LIBRARIES})
target_link_libraries(
obs PRIVATE CURL::libcurl FFmpeg::avcodec FFmpeg::avutil FFmpeg::avformat
OBS::libobs OBS::frontend-api)
set_target_properties(obs PROPERTIES FOLDER "frontend")
if(TARGET OBS::browser-panels)
get_target_property(_PANEL_INCLUDE_DIRECTORY OBS::browser-panels
INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(obs PRIVATE ${_PANEL_INCLUDE_DIRECTORY})
target_compile_definitions(obs PRIVATE BROWSER_AVAILABLE)
target_sources(
obs PRIVATE window-dock-browser.cpp window-dock-browser.hpp
window-extra-browsers.cpp window-extra-browsers.hpp)
if(TWITCH_ENABLED)
target_sources(obs PRIVATE auth-twitch.cpp auth-twitch.hpp)
endif()
if(RESTREAM_ENABLED)
target_sources(obs PRIVATE auth-restream.cpp auth-restream.hpp)
endif()
endif()
if(YOUTUBE_ENABLED)
target_sources(
obs
PRIVATE auth-youtube.cpp auth-youtube.hpp youtube-api-wrappers.cpp
youtube-api-wrappers.hpp window-youtube-actions.cpp
window-youtube-actions.hpp)
endif()
if(OS_WINDOWS)
set_target_properties(obs PROPERTIES WIN32_EXECUTABLE ON OUTPUT_NAME
"obs${_ARCH_SUFFIX}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/obs.rc.in
${CMAKE_BINARY_DIR}/obs.rc)
target_sources(
obs
PRIVATE obs.manifest
platform-windows.cpp
win-update/update-window.cpp
win-update/update-window.hpp
win-update/win-update.cpp
win-update/win-update.hpp
win-update/win-update-helpers.cpp
win-update/win-update-helpers.hpp
${CMAKE_BINARY_DIR}/obs.rc)
target_link_libraries(obs PRIVATE crypt32 OBS::blake2 Qt::WinExtras)
target_compile_features(obs PRIVATE cxx_std_17)
target_compile_definitions(
obs PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS
_CRT_NONSTDC_NO_WARNINGS)
if(MSVC)
target_link_libraries(obs PRIVATE OBS::w32-pthreads)
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}../deps/libff/libff/ff-util.c
PROPERTIES COMPILE_FLAGS -Dinline=__inline)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
target_link_options(obs PRIVATE /LARGEADDRESSAWARE)
endif()
add_subdirectory(win-update/updater)
elseif(OS_MACOS)
set_target_properties(
obs
PROPERTIES OUTPUT_NAME ${OBS_BUNDLE_NAME}
MACOSX_BUNDLE ON
MACOSX_BUNDLE_INFO_PLIST
${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/Info.plist.in)
if(XCODE)
set_target_properties(
obs
PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER
"${MACOSX_BUNDLE_GUI_IDENTIFIER}"
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon
XCODE_ATTRIBUTE_PRODUCT_NAME "OBS")
set(APP_ICON_TARGET ${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/Assets.xcassets)
target_sources(obs PRIVATE ${APP_ICON_TARGET})
set_source_files_properties(${APP_ICON_TARGET}
PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
else()
set(APP_ICON_TARGET ${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/AppIcon.iconset)
set(APP_ICON_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/AppIcon.icns)
add_custom_command(
OUTPUT ${APP_ICON_OUTPUT} COMMAND iconutil -c icns "${APP_ICON_TARGET}"
-o "${APP_ICON_OUTPUT}")
set(MACOSX_BUNDLE_ICON_FILE AppIcon.icns)
target_sources(obs PRIVATE ${APP_ICON_OUTPUT}
${CMAKE_CURRENT_SOURCE_DIR}/../AUTHORS)
set_source_files_properties(${APP_ICON_OUTPUT}
PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
endif()
find_library(APPKIT Appkit)
mark_as_advanced(APPKIT)
target_link_libraries(obs PRIVATE ${APPKIT})
if(ENABLE_SPARKLE_UPDATER)
find_library(SPARKLE Sparkle)
mark_as_advanced(SPARKLE)
target_sources(obs PRIVATE sparkle-updater.mm)
target_compile_definitions(obs PRIVATE ENABLE_SPARKLE_UPDATER)
target_link_libraries(obs PRIVATE ${SPARKLE})
endif()
target_sources(obs PRIVATE platform-osx.mm)
set_source_files_properties(platform-osx.mm PROPERTIES COMPILE_FLAGS
-fobjc-arc)
elseif(OS_POSIX)
target_sources(obs PRIVATE platform-x11.cpp)
target_link_libraries(obs PRIVATE Qt${QT_VERSION}::GuiPrivate)
if(TARGET obspython)
find_package(Python REQUIRED COMPONENTS Interpreter Development)
target_link_libraries(obs PRIVATE Python::Python)
target_link_options(obs PRIVATE "LINKER:-no-as-needed")
endif()
if(NOT LINUX_PORTABLE)
add_subdirectory(xdg-data)
endif()
if(OS_FREEBSD)
target_link_libraries(obs PRIVATE procstat)
endif()
endif()
define_graphic_modules(obs)
install_obs_core(obs)
install_obs_data(obs data obs-studio)
install_obs_data_file(obs ../AUTHORS obs-studio/authors)
if (UNIX AND UNIX_STRUCTURE AND NOT APPLE)
add_subdirectory(xdg-data)
endif()
if (UNIX AND NOT APPLE)
# python symbols must be in the global symbol table
# so we link the main executable to python if we expect
# obs-scripting python support to be enabled.
# see: https://github.com/obsproject/obs-studio/issues/2222 and https://bugs.python.org/issue36721
if(NOT DISABLE_PYTHON AND PYTHONLIBS_FOUND)
target_link_libraries(obs ${PYTHON_LIBRARIES})
set_target_properties(obs PROPERTIES LINK_FLAGS "-Wl,--no-as-needed")
# Use this after cmake 3.13 aka we drop ubuntu 18.04.
# target_link_options(obs PRIVATE "LINKER:-no-as-needed")
endif()
endif()
add_subdirectory(frontend-plugins)
if(WIN32)
add_subdirectory(win-update/updater)
endif()
setup_obs_app(obs)
setup_target_resources(obs obs-studio)
add_target_resource(obs ${CMAKE_CURRENT_SOURCE_DIR}/../AUTHORS
obs-studio/authors)

View File

@ -1,161 +1,85 @@
project(aja-output-ui)
if(DISABLE_AJA)
message(STATUS "aja-output-ui plugin disabled")
return()
if(NOT ENABLE_AJA)
return()
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
find_package(LibAJANTV2)
if (NOT LIBAJANTV2_FOUND)
message(STATUS "aja-output-ui plugin disabled (deps not found)")
return()
else()
message("aja-output-ui includes: ${LIBAJANTV2_INCLUDE_DIRS}")
message("aja-output-ui libs: ${LIBAJANTV2_LIBRARIES}")
endif()
find_package(LibAJANTV2 REQUIRED)
add_library(aja-output-ui MODULE)
add_library(OBS::aja-output-ui ALIAS aja-output-ui)
find_qt(VERSION ${QT_VERSION} COMPONENTS Widgets)
set_target_properties(
aja-output-ui
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS "forms")
target_sources(
aja-output-ui
PRIVATE AJAOutputUI.h
AJAOutputUI.cpp
aja-ui-main.cpp
aja-ui-main.h
${CMAKE_SOURCE_DIR}/plugins/aja/aja-card-manager.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-card-manager.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-common.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-common.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-enums.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-presets.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-presets.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-props.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-props.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-routing.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-routing.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-ui-props.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-vpid-data.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-vpid-data.hpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-widget-io.cpp
${CMAKE_SOURCE_DIR}/plugins/aja/aja-widget-io.hpp
${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/double-slider.cpp
${CMAKE_SOURCE_DIR}/UI/double-slider.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.cpp
${CMAKE_SOURCE_DIR}/UI/properties-view.moc.hpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.cpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.hpp
${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp)
target_link_libraries(aja-output-ui PRIVATE OBS::libobs OBS::frontend-api
Qt::Widgets AJA::LibAJANTV2)
if(OS_MACOS)
find_library(IOKIT_FRAMEWORK Iokit)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(APPKIT_FRAMEWORK AppKit)
target_link_libraries(aja-output-ui PRIVATE ${IOKIT} ${COREFOUNDATION}
${APPKIT})
elseif(OS_WINDOWS)
set(MODULE_DESCRIPTION "OBS AJA Output UI")
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
aja-output-ui.rc)
target_sources(aja-output-ui PRIVATE aja-output-ui.rc)
target_link_libraries(aja-output-ui PRIVATE ws2_32.lib setupapi.lib Winmm.lib
netapi32.lib Shlwapi.lib)
else()
message(STATUS "aja-output-ui disabled (32-bit not supported)")
return()
find_package(X11 REQUIRED)
target_link_libraries(aja-output-ui PRIVATE X11::X11
Qt${QT_VERSION}::GuiPrivate)
endif()
if(APPLE)
find_library(COCOA Cocoa)
include_directories(${COCOA})
endif()
set_target_properties(aja-output-ui PROPERTIES FOLDER "frontend" PREFIX "")
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
link_libraries(${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})
find_package(Qt5X11Extras REQUIRED)
endif()
set(aja-output-ui_HEADERS
${aja-output-ui_HEADERS}
../../qt-wrappers.hpp
../../properties-view.hpp
../../properties-view.moc.hpp
../../vertical-scroll-area.hpp
../../double-slider.hpp
../../slider-ignorewheel.hpp
../../combobox-ignorewheel.hpp
../../spinbox-ignorewheel.hpp
AJAOutputUI.h
aja-ui-main.h
../../../plugins/aja/aja-card-manager.hpp
../../../plugins/aja/aja-common.hpp
../../../plugins/aja/aja-enums.hpp
../../../plugins/aja/aja-presets.hpp
../../../plugins/aja/aja-props.hpp
../../../plugins/aja/aja-routing.hpp
../../../plugins/aja/aja-ui-props.hpp
../../../plugins/aja/aja-vpid-data.hpp
../../../plugins/aja/aja-widget-io.hpp
)
set(aja-output-ui_SOURCES
${aja-output-ui_SOURCES}
../../qt-wrappers.cpp
../../properties-view.cpp
../../vertical-scroll-area.cpp
../../double-slider.cpp
../../slider-ignorewheel.cpp
../../combobox-ignorewheel.cpp
../../spinbox-ignorewheel.cpp
AJAOutputUI.cpp
aja-ui-main.cpp
../../../plugins/aja/aja-card-manager.cpp
../../../plugins/aja/aja-common.cpp
../../../plugins/aja/aja-presets.cpp
../../../plugins/aja/aja-props.cpp
../../../plugins/aja/aja-routing.cpp
../../../plugins/aja/aja-vpid-data.cpp
../../../plugins/aja/aja-widget-io.cpp
)
set(aja-output-ui_UI
${aja-output-ui_UI}
forms/output.ui)
if(WIN32)
set(MODULE_DESCRIPTION "OBS AJA Output UI")
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in aja-output-ui.rc)
list(APPEND aja-output-ui_SOURCES
aja-output-ui.rc)
endif()
if(APPLE)
set(aja-output-ui_PLATFORM_LIBS
${COCOA})
endif()
qt5_wrap_ui(aja-output-ui_UI_HEADERS
${aja-output-ui_UI})
add_library(aja-output-ui MODULE
${aja-output-ui_HEADERS}
${aja-output-ui_SOURCES}
${aja-output-ui_UI_HEADERS})
set(aja_LIBRARIES
$<IF:$<CONFIG:Debug>,${LIBAJANTV2_DEBUG_LIBRARIES},${LIBAJANTV2_LIBRARIES}>
libobs)
# macOS
if(APPLE)
set(aja_COMPILE_DEFS
AJAMac
AJA_MAC)
find_library(IOKIT_FRAMEWORK Iokit)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(APPKIT_FRAMEWORK AppKit)
list(APPEND aja_LIBRARIES
${IOKIT_FRAMEWORK}
${COREFOUNDATION_LIBRARY}
${APPKIT_FRAMEWORK})
# Windows
elseif(WIN32)
set(aja_COMPILE_DEFS
AJA_WINDOWS
_WINDOWS
WIN32
MSWindows)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
list(APPEND aja_COMPILE_DEFS
_DEBUG)
else()
list(APPEND aja_COMPILE_DEFS
NDEBUG)
endif()
list(APPEND aja_LIBRARIES
ws2_32.lib
setupapi.lib
Winmm.lib
netapi32.lib
Shlwapi.lib)
# Linux
elseif(UNIX AND NOT APPLE)
set(aja_COMPILE_DEFS
AJA_LINUX
AJALinux)
endif()
target_include_directories(aja-output-ui PUBLIC
${LIBAJANTV2_INCLUDE_DIRS})
target_compile_definitions(aja-output-ui PUBLIC ${aja_COMPILE_DEFS})
target_link_libraries(aja-output-ui
${frontend-tools_PLATFORM_LIBS}
${aja_LIBRARIES}
obs-frontend-api
Qt5::Widgets
libobs)
set_target_properties(aja-output-ui PROPERTIES FOLDER "frontend")
install_obs_plugin_with_data(aja-output-ui data)
setup_plugin_target(aja-output-ui)

View File

@ -1,51 +1,48 @@
project(decklink-captions)
if(APPLE)
find_library(COCOA Cocoa)
include_directories(${COCOA})
if(NOT ENABLE_DECKLINK)
return()
endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
link_libraries(${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})
add_library(decklink-captions MODULE)
add_library(OBS::decklink-captions ALIAS decklink-captions)
find_qt(VERSION ${QT_VERSION} COMPONENTS Widgets)
target_link_libraries(decklink-captions PRIVATE Qt::Widgets)
set_target_properties(
decklink-captions
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS "forms")
target_compile_features(decklink-captions PRIVATE cxx_std_17)
target_sources(decklink-captions PRIVATE decklink-captions.cpp
decklink-captions.h)
target_link_libraries(decklink-captions PRIVATE OBS::frontend-api OBS::libobs)
if(OS_MACOS)
find_library(COCOA Cocoa)
mark_as_advanced(COCOA)
target_link_libraries(decklink-captions PRIVATE ${COCOA})
elseif(OS_POSIX)
find_package(X11 REQUIRED)
mark_as_advanced(X11)
target_link_libraries(decklink-captions PRIVATE X11::X11)
elseif(OS_WINDOWS)
set(MODULE_DESCRIPTION "OBS DeckLink Captions module")
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
decklink-captions.rc)
target_sources(decklink-captions PRIVATE decklink-captions.rc)
endif()
set(decklink-captions_HEADERS
decklink-captions.h
)
set(decklink-captions_SOURCES
decklink-captions.cpp
)
set(decklink-captions_UI
forms/captions.ui
)
set_target_properties(decklink-captions PROPERTIES FOLDER "plugins/decklink"
PREFIX "")
if(WIN32)
set(MODULE_DESCRIPTION "OBS DeckLink Captions module")
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in decklink-captions.rc)
list(APPEND decklink-captions_SOURCES
decklink-captions.rc)
endif()
if(APPLE)
set(decklink-captions_PLATFORM_LIBS
${COCOA})
endif()
qt5_wrap_ui(decklink-captions_UI_HEADERS
${decklink-captions_UI})
add_library(decklink-captions MODULE
${decklink-captions_HEADERS}
${decklink-captions_SOURCES}
${decklink-captions_UI_HEADERS}
)
target_link_libraries(decklink-captions
${frontend-tools_PLATFORM_LIBS}
obs-frontend-api
Qt5::Widgets
libobs)
set_target_properties(decklink-captions PROPERTIES FOLDER "plugins/decklink")
install_obs_plugin_with_data(decklink-captions data)
setup_plugin_target(decklink-captions)

View File

@ -1,72 +1,104 @@
project(decklink-output-ui)
if(APPLE)
find_library(COCOA Cocoa)
include_directories(${COCOA})
if(NOT ENABLE_DECKLINK)
return()
endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
link_libraries(${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})
if(NOT COMMAND find_qt)
macro(find_qt)
set(oneValueArgs VERSION)
set(multiValueArgs COMPONENTS COMPONENTS_WIN COMPONENTS_MAC
COMPONENTS_LINUX)
cmake_parse_arguments(FIND_QT "" "${oneValueArgs}" "${multiValueArgs}"
${ARGN})
if(OS_WINDOWS)
find_package(
Qt${FIND_QT_VERSION}
COMPONENTS ${FIND_QT_COMPONENTS} ${FIND_QT_COMPONENTS_WIN}
REQUIRED)
elseif(OS_MACOS)
find_package(
Qt${FIND_QT_VERSION}
COMPONENTS ${FIND_QT_COMPONENTS} ${FIND_QT_COMPONENTS_MAC}
REQUIRED)
else()
find_package(
Qt${FIND_QT_VERSION}
COMPONENTS ${FIND_QT_COMPONENTS} ${FIND_QT_COMPONENTS_LINUX}
REQUIRED)
endif()
foreach(_COMPONENT IN LISTS ${FIND_QT_COMPONENTS})
if(NOT TARGET Qt::${_COMPONENT} AND TARGET
Qt${FIND_QT_VERSION}::${_COMPONENT})
add_library(Qt::${_COMPONENT} ALIAS Qt${FIND_QT_VERSION}::${_COMPONENT})
endif()
endforeach()
endmacro()
endif()
set(decklink-ouput-ui_HEADERS
${decklink-ouput-ui_HEADERS}
../../qt-wrappers.hpp
../../properties-view.hpp
../../properties-view.moc.hpp
../../vertical-scroll-area.hpp
../../double-slider.hpp
../../slider-ignorewheel.hpp
../../combobox-ignorewheel.hpp
../../spinbox-ignorewheel.hpp
./DecklinkOutputUI.h
decklink-ui-main.h
)
set(decklink-ouput-ui_SOURCES
${decklink-ouput-ui_SOURCES}
../../qt-wrappers.cpp
../../properties-view.cpp
../../vertical-scroll-area.cpp
../../double-slider.cpp
../../slider-ignorewheel.cpp
../../combobox-ignorewheel.cpp
../../spinbox-ignorewheel.cpp
./DecklinkOutputUI.cpp
decklink-ui-main.cpp
)
set(decklink-ouput-ui_UI
${decklink-ouput-ui_UI}
forms/output.ui
)
add_library(decklink-output-ui MODULE)
add_library(OBS::decklink-output-ui ALIAS decklink-output-ui)
if(WIN32)
set(MODULE_DESCRIPTION "OBS DeckLink Output UI")
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in decklink-ouput-ui.rc)
list(APPEND decklink-ouput-ui_SOURCES
decklink-ouput-ui.rc)
find_qt(
VERSION ${QT_VERSION}
COMPONENTS Widgets
COMPONENTS_LINUX Gui)
set_target_properties(
decklink-output-ui
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS "forms")
target_sources(
decklink-output-ui
PRIVATE DecklinkOutputUI.cpp
DecklinkOutputUI.h
decklink-ui-main.cpp
decklink-ui-main.h
${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/double-slider.cpp
${CMAKE_SOURCE_DIR}/UI/double-slider.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.cpp
${CMAKE_SOURCE_DIR}/UI/properties-view.moc.hpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.hpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.cpp
${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp)
target_link_libraries(decklink-output-ui PRIVATE OBS::libobs OBS::frontend-api
Qt::Widgets)
target_compile_features(decklink-output-ui PRIVATE cxx_std_17)
set_target_properties(decklink-output-ui PROPERTIES FOLDER "frontend" PREFIX "")
if(OS_WINDOWS)
set(MODULE_DESCRIPTION "OBS Decklink Output UI")
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
decklink-output-ui.rc)
target_sources(decklink-output-ui PRIVATE decklink-output-ui.rc)
elseif(OS_MACOS)
find_library(COCOA Cocoa)
mark_as_advanced(COCOA)
target_link_libraries(decklink-output-ui PRIVATE ${COCOA})
elseif(OS_POSIX)
find_package(X11 REQUIRED)
target_link_libraries(decklink-output-ui PRIVATE X11::X11
Qt${QT_VERSION}::GuiPrivate)
endif()
if(APPLE)
set(decklink-ouput-ui_PLATFORM_LIBS
${COCOA})
endif()
qt5_wrap_ui(decklink-ouput-ui_UI_HEADERS
${decklink-ouput-ui_UI})
add_library(decklink-ouput-ui MODULE
${decklink-ouput-ui_HEADERS}
${decklink-ouput-ui_SOURCES}
${decklink-ouput-ui_UI_HEADERS}
)
target_link_libraries(decklink-ouput-ui
${frontend-tools_PLATFORM_LIBS}
obs-frontend-api
Qt5::Widgets
libobs)
set_target_properties(decklink-ouput-ui PROPERTIES FOLDER "frontend")
install_obs_plugin_with_data(decklink-ouput-ui data)
setup_plugin_target(decklink-output-ui)

View File

@ -1,128 +1,106 @@
project(frontend-tools)
if(APPLE)
find_library(COCOA Cocoa)
include_directories(${COCOA})
add_library(frontend-tools MODULE)
add_library(OBS::frontend-tools ALIAS frontend-tools)
find_qt(
VERSION ${QT_VERSION}
COMPONENTS Widgets
COMPONENTS_LINUX Gui)
set_target_properties(
frontend-tools
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS "forms")
target_sources(
frontend-tools
PRIVATE frontend-tools.c
auto-scene-switcher.hpp
auto-scene-switcher.cpp
output-timer.hpp
tool-helpers.hpp
output-timer.cpp
${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/combobox-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/double-slider.cpp
${CMAKE_SOURCE_DIR}/UI/double-slider.hpp
${CMAKE_SOURCE_DIR}/UI/horizontal-scroll-area.cpp
${CMAKE_SOURCE_DIR}/UI/horizontal-scroll-area.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.cpp
${CMAKE_SOURCE_DIR}/UI/properties-view.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.moc.hpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.cpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.hpp
${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp)
target_compile_features(frontend-tools PRIVATE cxx_std_17)
target_link_libraries(frontend-tools PRIVATE OBS::frontend-api OBS::libobs
Qt::Widgets)
if(OS_POSIX AND NOT OS_MACOS)
target_link_libraries(frontend-tools PRIVATE Qt${QT_VERSION}::GuiPrivate)
endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
link_libraries(${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})
if(ENABLE_SCRIPTING AND TARGET OBS::scripting)
target_compile_definitions(frontend-tools PRIVATE ENABLE_SCRIPTING)
target_sources(frontend-tools PRIVATE scripts.cpp scripts.hpp)
target_link_libraries(frontend-tools PRIVATE OBS::scripting)
if(TARGET obslua)
target_compile_definitions(frontend-tools PRIVATE LUAJIT_FOUND)
endif()
if(TARGET obspython)
target_compile_definitions(frontend-tools PRIVATE Python_FOUND)
endif()
endif()
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/deps/obs-scripting")
set_target_properties(frontend-tools PROPERTIES FOLDER "frontend" PREFIX "")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/frontend-tools-config.h.in"
"${CMAKE_BINARY_DIR}/config/frontend-tools-config.h")
if(OS_WINDOWS)
set(MODULE_DESCRIPTION "OBS Frontend Tools")
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
frontend-tools.rc)
set(frontend-tools_HEADERS
${frontend-tools_HEADERS}
"${CMAKE_BINARY_DIR}/config/frontend-tools-config.h"
auto-scene-switcher.hpp
output-timer.hpp
tool-helpers.hpp
../../properties-view.hpp
../../properties-view.moc.hpp
../../horizontal-scroll-area.hpp
../../vertical-scroll-area.hpp
../../double-slider.hpp
../../slider-ignorewheel.hpp
../../combobox-ignorewheel.hpp
../../spinbox-ignorewheel.hpp
../../qt-wrappers.hpp
)
set(frontend-tools_SOURCES
${frontend-tools_SOURCES}
auto-scene-switcher.cpp
frontend-tools.c
output-timer.cpp
../../properties-view.cpp
../../horizontal-scroll-area.cpp
../../vertical-scroll-area.cpp
../../double-slider.cpp
../../slider-ignorewheel.cpp
../../combobox-ignorewheel.cpp
../../spinbox-ignorewheel.cpp
../../qt-wrappers.cpp
)
set(frontend-tools_UI
${frontend-tools_UI}
forms/auto-scene-switcher.ui
forms/output-timer.ui
)
target_sources(
frontend-tools
PRIVATE auto-scene-switcher-win.cpp
frontend-tools.rc
captions.cpp
captions.hpp
captions-handler.cpp
captions-handler.hpp
captions-mssapi.cpp
captions-mssapi.hpp
captions-mssapi-stream.cpp
captions-mssapi-stream.hpp)
if(SCRIPTING_ENABLED)
set(frontend-tools_HEADERS
${frontend-tools_HEADERS}
scripts.hpp
)
set(frontend-tools_SOURCES
${frontend-tools_SOURCES}
scripts.cpp
)
set(frontend-tools_UI
${frontend-tools_UI}
forms/scripts.ui
)
set(EXTRA_LIBS
${EXTRA_LIBS}
obs-scripting
)
elseif(OS_MACOS)
find_library(COCOA Cocoa)
mark_as_advanced(COCOA)
target_link_libraries(frontend-tools PRIVATE ${COCOA})
target_sources(frontend-tools PRIVATE auto-scene-switcher-osx.mm)
set_source_files_properties(auto-scene-switcher-osx.mm
PROPERTIES COMPILE_FLAGS -fobjc-arc)
elseif(OS_POSIX)
find_package(X11 REQUIRED)
target_link_libraries(frontend-tools PRIVATE X11::X11)
target_sources(frontend-tools PRIVATE auto-scene-switcher-nix.cpp)
endif()
if(WIN32)
set(MODULE_DESCRIPTION "OBS Frontend Tools")
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in frontend-tools.rc)
set(frontend-tools_PLATFORM_SOURCES
auto-scene-switcher-win.cpp
frontend-tools.rc)
set(frontend-tools_PLATFORM_SOURCES
${frontend-tools_PLATFORM_SOURCES}
captions.cpp
captions-handler.cpp
captions-mssapi.cpp
captions-mssapi-stream.cpp)
set(frontend-tools_PLATFORM_HEADERS
captions.hpp
captions-handler.hpp
captions-mssapi.hpp
captions-mssapi-stream.hpp)
set(frontend-tools_PLATFORM_UI
forms/captions.ui)
elseif(APPLE)
set(frontend-tools_PLATFORM_SOURCES
auto-scene-switcher-osx.mm)
set_source_files_properties(auto-scene-switcher-osx.mm
PROPERTIES COMPILE_FLAGS "-fobjc-arc")
set(frontend-tools_PLATFORM_LIBS
${COCOA})
else()
set(frontend-tools_PLATFORM_SOURCES
auto-scene-switcher-nix.cpp)
endif()
qt5_wrap_ui(frontend-tools_UI_HEADERS
${frontend-tools_UI}
${frontend-tools_PLATFORM_UI})
add_library(frontend-tools MODULE
${frontend-tools_HEADERS}
${frontend-tools_SOURCES}
${frontend-tools_UI_HEADERS}
${frontend-tools_PLATFORM_SOURCES}
${frontend-tools_PLATFORM_HEADERS}
)
target_link_libraries(frontend-tools
${frontend-tools_PLATFORM_LIBS}
${EXTRA_LIBS}
obs-frontend-api
Qt5::Widgets
libobs)
set_target_properties(frontend-tools PROPERTIES FOLDER "frontend")
install_obs_plugin_with_data(frontend-tools data)
setup_plugin_target(frontend-tools)

View File

@ -16,6 +16,6 @@
#define OFF 0
#endif
#define ENABLE_SCRIPTING @SCRIPTING_ENABLED@
#define COMPILE_LUA @COMPILE_LUA@
#define COMPILE_PYTHON @COMPILE_PYTHON@
#cmakedefine ENABLE_SCRIPTING
#cmakedefine LUAJIT_FOUND
#cmakedefine Python_FOUND

View File

@ -1,5 +1,4 @@
#include <obs-module.h>
#include "frontend-tools-config.h"
OBS_DECLARE_MODULE()
OBS_MODULE_USE_DEFAULT_LOCALE("frontend-tools", "en-US")
@ -15,7 +14,7 @@ void FreeCaptions();
void InitOutputTimer();
void FreeOutputTimer();
#if ENABLE_SCRIPTING
#if defined(ENABLE_SCRIPTING)
void InitScripts();
void FreeScripts();
#endif
@ -27,7 +26,7 @@ bool obs_module_load(void)
#endif
InitSceneSwitcher();
InitOutputTimer();
#if ENABLE_SCRIPTING
#if defined(ENABLE_SCRIPTING)
InitScripts();
#endif
return true;
@ -40,7 +39,7 @@ void obs_module_unload(void)
#endif
FreeSceneSwitcher();
FreeOutputTimer();
#if ENABLE_SCRIPTING
#if defined(ENABLE_SCRIPTING)
FreeScripts();
#endif
}

View File

@ -1,6 +1,5 @@
#include "obs-module.h"
#include "scripts.hpp"
#include "frontend-tools-config.h"
#include "../../properties-view.hpp"
#include "../../qt-wrappers.hpp"
@ -33,7 +32,7 @@
#include "ui_scripts.h"
#if COMPILE_PYTHON && (defined(_WIN32) || defined(__APPLE__))
#if defined(Python_FOUND) && (defined(_WIN32) || defined(__APPLE__))
#define PYTHON_UI 1
#else
#define PYTHON_UI 0

View File

@ -2064,6 +2064,12 @@ static int run_program(fstream &logFile, int argc, char *argv[])
#if __APPLE__
InstallNSApplicationSubclass();
if (!isInBundle()) {
blog(LOG_ERROR,
"OBS cannot be run as a standalone binary on macOS. Run the Application bundle instead.");
return ret;
}
#endif
#if !defined(_WIN32) && !defined(__APPLE__) && defined(USE_XDG) && \
@ -2339,13 +2345,13 @@ static void load_debug_privilege(void)
#define CONFIG_PATH BASE_PATH "/config"
#ifndef OBS_UNIX_STRUCTURE
#define OBS_UNIX_STRUCTURE 0
#ifndef LINUX_PORTABLE
#define LINUX_PORTABLE 0
#endif
int GetConfigPath(char *path, size_t size, const char *name)
{
if (!OBS_UNIX_STRUCTURE && portable_mode) {
if (LINUX_PORTABLE && portable_mode) {
if (name && *name) {
return snprintf(path, size, CONFIG_PATH "/%s", name);
} else {
@ -2358,7 +2364,7 @@ int GetConfigPath(char *path, size_t size, const char *name)
char *GetConfigPathPtr(const char *name)
{
if (!OBS_UNIX_STRUCTURE && portable_mode) {
if (LINUX_PORTABLE && portable_mode) {
char path[512];
if (snprintf(path, sizeof(path), CONFIG_PATH "/%s", name) > 0) {
@ -2870,7 +2876,7 @@ int main(int argc, char *argv[])
}
}
#if !OBS_UNIX_STRUCTURE
#if defined(LINUX_PORTABLE)
if (!portable_mode) {
portable_mode =
os_file_exists(BASE_PATH "/portable_mode") ||

View File

@ -1,41 +1,40 @@
if(POLICY CMP0090)
cmake_policy(SET CMP0090 NEW)
endif()
project(obs-frontend-api)
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
add_library(obs-frontend-api SHARED)
add_library(OBS::frontend-api ALIAS obs-frontend-api)
add_definitions(-DLIBOBS_EXPORTS)
target_sources(obs-frontend-api PRIVATE obs-frontend-api.h obs-frontend-api.cpp
obs-frontend-internal.hpp)
set(obs-frontend-api_SOURCES
obs-frontend-api.cpp)
target_link_libraries(obs-frontend-api PRIVATE OBS::libobs)
if(WIN32)
set(MODULE_DESCRIPTION "OBS Frontend API")
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in ./obs-frontend-api.rc)
list(APPEND obs-frontend-api_SOURCES
obs-frontend-api.rc)
target_compile_features(obs-frontend-api PUBLIC cxx_auto_type cxx_std_17
c_std_11)
target_include_directories(
obs-frontend-api PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${OBS_INCLUDE_DESTINATION}>)
set_target_properties(
obs-frontend-api
PROPERTIES FOLDER "frontend"
VERSION "${OBS_VERSION_MAJOR}"
SOVERSION "0"
PUBLIC_HEADER obs-frontend-api.h)
if(OS_WINDOWS)
set(MODULE_DESCRIPTION "OBS Frontend API")
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
obs-frontend-api.rc)
target_sources(obs-frontend-api PRIVATE obs-frontend-api.rc)
elseif(OS_MACOS)
set_target_properties(obs-frontend-api PROPERTIES SOVERSION "1")
endif()
set(obs-frontend-api_PUBLIC_HEADERS
obs-frontend-api.h)
set(obs-frontend-api_HEADERS
obs-frontend-internal.hpp
${obs-frontend-api_PUBLIC_HEADERS})
add_library(obs-frontend-api SHARED
${obs-frontend-api_SOURCES}
${obs-frontend-api_HEADERS})
target_link_libraries(obs-frontend-api
libobs)
set_target_properties(obs-frontend-api PROPERTIES FOLDER "frontend")
if(UNIX AND NOT APPLE)
set_target_properties(obs-frontend-api
PROPERTIES
OUTPUT_NAME obs-frontend-api
VERSION 0.0
SOVERSION 0
)
endif()
install_obs_core(obs-frontend-api)
install_obs_headers(${obs-frontend-api_PUBLIC_HEADERS})
setup_binary_target(obs-frontend-api)
export_target(obs-frontend-api)

View File

@ -0,0 +1,4 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
check_required_components("@PROJECT_NAME@")

View File

@ -1,4 +1,4 @@
IDI_ICON1 ICON DISCARDABLE "../cmake/winrc/obs-studio.ico"
IDI_ICON1 ICON DISCARDABLE "../cmake/bundle/windows/obs-studio.ico"
1 VERSIONINFO
FILEVERSION ${UI_VERSION_MAJOR},${UI_VERSION_MINOR},${UI_VERSION_PATCH},0

View File

@ -37,55 +37,21 @@ bool isInBundle()
bool GetDataFilePath(const char *data, string &output)
{
if (isInBundle()) {
NSRunningApplication *app =
[NSRunningApplication currentApplication];
NSURL *bundleURL = [app bundleURL];
NSString *path = [NSString
stringWithFormat:@"Contents/Resources/data/obs-studio/%@",
[NSString stringWithUTF8String:data]];
NSURL *dataURL = [bundleURL URLByAppendingPathComponent:path];
output = [[dataURL path] UTF8String];
} else {
stringstream str;
str << OBS_DATA_PATH "/obs-studio/" << data;
output = str.str();
}
NSRunningApplication *app = [NSRunningApplication currentApplication];
NSURL *bundleURL = [app bundleURL];
NSString *path = [NSString
stringWithFormat:@"Contents/Resources/%@",
[NSString stringWithUTF8String:data]];
NSURL *dataURL = [bundleURL URLByAppendingPathComponent:path];
output = [[dataURL path] UTF8String];
return !access(output.c_str(), R_OK);
}
#pragma deprecated(InitApplicationBundle)
bool InitApplicationBundle()
{
#ifdef OBS_OSX_BUNDLE
static bool initialized = false;
if (initialized)
return true;
try {
NSBundle *bundle = [NSBundle mainBundle];
if (!bundle)
throw "Could not find main bundle";
NSString *exe_path = [bundle executablePath];
if (!exe_path)
throw "Could not find executable path";
NSString *path = [exe_path stringByDeletingLastPathComponent];
if (chdir([path fileSystemRepresentation]))
throw "Could not change working directory to "
"bundle path";
} catch (const char *error) {
blog(LOG_ERROR, "InitBundle: %s", error);
return false;
}
return initialized = true;
#else
return true;
#endif
}
void CheckIfAlreadyRunning(bool &already_running)

View File

@ -28,7 +28,7 @@ class QWidget;
bool GetDataFilePath(const char *data, std::string &path);
/* Updates the working directory for OSX application bundles */
bool InitApplicationBundle();
bool OBS_DEPRECATED InitApplicationBundle();
std::string GetDefaultVideoSavePath();
@ -77,6 +77,7 @@ bool IsRunningOnWine();
#ifdef __APPLE__
void EnableOSXVSync(bool enable);
void EnableOSXDockIcon(bool enable);
bool isInBundle();
void InstallNSApplicationSubclass();
void disableColorSpaceConversion(QWidget *window);
bool ProcessIsRosettaTranslated();

View File

@ -16,6 +16,8 @@
#define OFF 0
#endif
#cmakedefine USE_XDG
#define TWITCH_ENABLED @TWITCH_ENABLED@
#define TWITCH_CLIENTID "@TWITCH_CLIENTID@"
#define TWITCH_HASH 0x@TWITCH_HASH@

View File

@ -1,52 +1,46 @@
if(DISABLE_UPDATE_MODULE)
return()
project(updater)
option(ENABLE_UPDATER "Build with Windows updater" ON)
if(NOT ENABLE_UPDATER)
message(STATUS "OBS: DISABLED Windows updater")
return()
endif()
if(NOT DEFINED STATIC_ZLIB_PATH OR "${STATIC_ZLIB_PATH}" STREQUAL "")
message(STATUS "STATIC_ZLIB_PATH not set, windows updater disabled")
return()
message(STATUS "STATIC_ZLIB_PATH not set, windows updater disabled")
return()
endif()
project(updater)
add_executable(updater WIN32)
include_directories(${LIBLZMA_INCLUDE_DIRS})
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/deps/json11")
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
include_directories(${BLAKE2_INCLUDE_DIR})
target_sources(
updater
PRIVATE updater.cpp
updater.hpp
patch.cpp
http.cpp
hash.cpp
resource.h
updater.rc
init-hook-files.c
updater.manifest
${CMAKE_SOURCE_DIR}/UI/win-update/win-update-helpers.cpp
${CMAKE_SOURCE_DIR}/UI/win-update/win-update-helpers.hpp
${CMAKE_SOURCE_DIR}/deps/json11/json11.hpp
${CMAKE_SOURCE_DIR}/deps/json11/json11.cpp)
set(updater_HEADERS
${CMAKE_SOURCE_DIR}/deps/json11/json11.hpp
../win-update-helpers.hpp
resource.h
updater.hpp
)
set(updater_SOURCES
${CMAKE_SOURCE_DIR}/deps/json11/json11.cpp
../win-update-helpers.cpp
init-hook-files.c
updater.cpp
patch.cpp
http.cpp
hash.cpp
updater.rc
updater.manifest
)
target_include_directories(
updater PRIVATE ${CMAKE_SOURCE_DIR}/libobs ${CMAKE_SOURCE_DIR}/UI/win-update
${CMAKE_SOURCE_DIR}/deps/json11)
target_compile_definitions(updater PRIVATE NOMINMAX "PSAPI_VERSION=2")
add_definitions(-DNOMINMAX -DUNICODE -D_UNICODE -DPSAPI_VERSION=2)
if(MSVC)
add_compile_options($<IF:$<CONFIG:Debug>,/MTd,/MT>)
target_compile_options(updater PRIVATE $<IF:$<CONFIG:DEBUG>,/MTd,/MT>)
endif()
add_executable(updater WIN32
${updater_HEADERS}
${updater_SOURCES}
)
target_link_libraries(updater
${STATIC_ZLIB_PATH}
lzma
blake2
comctl32
shell32
winhttp
)
target_link_libraries(updater PRIVATE OBS::blake2 OBS::lzma ${STATIC_ZLIB_PATH}
comctl32 shell32 winhttp)
set_target_properties(updater PROPERTIES FOLDER "frontend")

View File

@ -127,7 +127,7 @@ END
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "../../../cmake/winrc/obs-studio.ico"
IDI_ICON1 ICON "../../../cmake/bundle/windows/obs-studio.ico"
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////

View File

@ -131,7 +131,11 @@ void OBSAbout::ShowAuthors()
QString error = "Error! File could not be read.\n\n \
Go to: https://github.com/obsproject/obs-studio/blob/master/AUTHORS";
#ifdef __APPLE__
if (!GetDataFilePath("AUTHORS", path)) {
#else
if (!GetDataFilePath("authors/AUTHORS", path)) {
#endif
ui->textBrowser->setPlainText(error);
return;
}

View File

@ -170,21 +170,35 @@ static void AddExtraModulePaths()
string path = base_module_dir;
#if defined(__APPLE__)
obs_add_module_path((path + "/bin").c_str(), (path + "/data").c_str());
/* System Library Search Path */
obs_add_module_path((path + ".plugin/Contents/MacOS").c_str(),
(path + ".plugin/Contents/Resources").c_str());
BPtr<char> config_bin =
os_get_config_path_ptr("obs-studio/plugins/%module%/bin");
BPtr<char> config_data =
os_get_config_path_ptr("obs-studio/plugins/%module%/data");
/* User Application Support Search Path */
BPtr<char> config_bin = os_get_config_path_ptr(
"obs-studio/plugins/%module%.plugin/Contents/MacOS");
BPtr<char> config_data = os_get_config_path_ptr(
"obs-studio/plugins/%module%.plugin/Contents/Resources");
obs_add_module_path(config_bin, config_data);
#elif ARCH_BITS == 64
/* Legacy System Library Search Path */
obs_add_module_path((path + "/bin").c_str(), (path + "/data").c_str());
/* Legacy User Application Support Search Path */
BPtr<char> config_bin_legacy =
os_get_config_path_ptr("obs-studio/plugins/%module%/bin");
BPtr<char> config_data_legacy =
os_get_config_path_ptr("obs-studio/plugins/%module%/data");
obs_add_module_path(config_bin_legacy, config_data_legacy);
#else
#if ARCH_BITS == 64
obs_add_module_path((path + "/bin/64bit").c_str(),
(path + "/data").c_str());
#else
obs_add_module_path((path + "/bin/32bit").c_str(),
(path + "/data").c_str());
#endif
#endif
}
extern obs_frontend_callbacks *InitializeAPIInterface(OBSBasic *main);
@ -2115,7 +2129,7 @@ void OBSBasic::ReceivedIntroJson(const QString &text)
int minor = 0;
sscanf(version.c_str(), "%d.%d", &major, &minor);
#if OBS_RELEASE_CANDIDATE > 0
#if defined(OBS_RELEASE_CANDIDATE) && OBS_RELEASE_CANDIDATE > 0
if (major == OBS_RELEASE_CANDIDATE_MAJOR &&
minor == OBS_RELEASE_CANDIDATE_MINOR &&
rc == OBS_RELEASE_CANDIDATE) {
@ -2136,7 +2150,7 @@ void OBSBasic::ReceivedIntroJson(const QString &text)
return;
}
#if OBS_RELEASE_CANDIDATE > 0
#if defined(OBS_RELEASE_CANDIDATE) && OBS_RELEASE_CANDIDATE > 0
uint32_t lastVersion = config_get_int(App()->GlobalConfig(), "General",
"LastRCVersion");
#elif OBS_BETA > 0
@ -2149,7 +2163,7 @@ void OBSBasic::ReceivedIntroJson(const QString &text)
int current_version_increment = -1;
#if OBS_RELEASE_CANDIDATE > 0
#if defined(OBS_RELEASE_CANDIDATE) && OBS_RELEASE_CANDIDATE > 0
if (lastVersion < OBS_RELEASE_CANDIDATE_VER) {
#elif OBS_BETA > 0
if (lastVersion < OBS_BETA_VER) {
@ -2642,7 +2656,7 @@ OBSBasic::~OBSBasic()
config_set_int(App()->GlobalConfig(), "General", "LastVersion",
LIBOBS_API_VER);
#if OBS_RELEASE_CANDIDATE > 0
#if defined(OBS_RELEASE_CANDIDATE) && OBS_RELEASE_CANDIDATE > 0
config_set_int(App()->GlobalConfig(), "General", "LastRCVersion",
OBS_RELEASE_CANDIDATE_VER);
#elif OBS_BETA > 0
@ -3626,7 +3640,7 @@ bool OBSBasic::QueryRemoveSource(obs_source_t *source)
#define UPDATE_CHECK_INTERVAL (60 * 60 * 24 * 4) /* 4 days */
#ifdef UPDATE_SPARKLE
#if defined(ENABLE_SPARKLE_UPDATER)
void init_sparkle_updater(bool update_to_undeployed);
void trigger_sparkle_update();
#endif
@ -3639,7 +3653,7 @@ void OBSBasic::TimedCheckForUpdates()
"EnableAutoUpdates"))
return;
#ifdef UPDATE_SPARKLE
#if defined(ENABLE_SPARKLE_UPDATER)
init_sparkle_updater(config_get_bool(App()->GlobalConfig(), "General",
"UpdateToUndeployed"));
#elif _WIN32
@ -3664,7 +3678,7 @@ void OBSBasic::TimedCheckForUpdates()
void OBSBasic::CheckForUpdates(bool manualUpdate)
{
#ifdef UPDATE_SPARKLE
#if defined(ENABLE_SPARKLE_UPDATER)
trigger_sparkle_update();
#elif _WIN32
ui->actionCheckForUpdates->setEnabled(false);

View File

@ -640,7 +640,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
delete ui->browserHWAccel;
delete ui->sourcesGroup;
#endif
#if defined(__APPLE__) || HAVE_PULSEAUDIO
#if defined(__APPLE__) || defined(PULSEAUDIO_FOUND)
delete ui->disableAudioDucking;
#endif
ui->rendererLabel = nullptr;
@ -656,7 +656,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
ui->browserHWAccel = nullptr;
ui->sourcesGroup = nullptr;
#endif
#if defined(__APPLE__) || HAVE_PULSEAUDIO
#if defined(__APPLE__) || defined(PULSEAUDIO_FOUND)
ui->disableAudioDucking = nullptr;
#endif
#endif

View File

@ -1,38 +1,41 @@
if(NOT DEFINED APPDATA_RELEASE_DATE)
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(COMMAND git log --tags -1 --pretty=%cd --date=short
OUTPUT_VARIABLE APPDATA_RELEASE_DATE
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
file(TIMESTAMP "${CMAKE_SOURCE_DIR}/CMakeLists.txt" APPDATA_RELEASE_DATE "%Y-%m-%d")
endif()
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(
COMMAND git log --tags -1 --pretty=%cd --date=short
OUTPUT_VARIABLE APPDATA_RELEASE_DATE
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
file(TIMESTAMP "${CMAKE_SOURCE_DIR}/CMakeLists.txt" APPDATA_RELEASE_DATE
"%Y-%m-%d")
endif()
endif()
configure_file(
com.obsproject.Studio.appdata.xml.in
com.obsproject.Studio.appdata.xml)
configure_file(com.obsproject.Studio.appdata.xml.in
com.obsproject.Studio.appdata.xml)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/com.obsproject.Studio.appdata.xml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
install(FILES com.obsproject.Studio.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
# Icons
install(
FILES icons/obs-logo-128.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps
RENAME com.obsproject.Studio.png)
install(FILES icons/obs-logo-128.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps
RENAME com.obsproject.Studio.png)
install(
FILES icons/obs-logo-256.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps
RENAME com.obsproject.Studio.png)
install(FILES icons/obs-logo-256.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps
RENAME com.obsproject.Studio.png)
install(
FILES icons/obs-logo-512.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps
RENAME com.obsproject.Studio.png)
install(FILES icons/obs-logo-512.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps
RENAME com.obsproject.Studio.png)
install(FILES icons/obs-logo-scalable.svg
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps
RENAME com.obsproject.Studio.svg)
install(
FILES icons/obs-logo-scalable.svg
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps
RENAME com.obsproject.Studio.svg)

View File

@ -0,0 +1,161 @@
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Set compile options for MSVC
if(OS_WINDOWS AND MSVC)
if(NOT EXISTS "${CMAKE_BINARY_DIR}/ALL_BUILD.vcxproj.user")
file(
GENERATE
OUTPUT "${CMAKE_BINARY_DIR}/ALL_BUILD.vcxproj.user"
INPUT "${CMAKE_SOURCE_DIR}/cmake/bundle/windows/ALL_BUILD.vcxproj.user.in"
)
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}"
)
string(REPLACE "." ";" WINAPI_VER
"${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
list(GET WINAPI_VER 0 WINAPI_VER_MAJOR)
list(GET WINAPI_VER 1 WINAPI_VER_MINOR)
list(GET WINAPI_VER 2 WINAPI_VER_BUILD)
set(WINAPI_COMPATIBLE FALSE)
if(WINAPI_VER_MAJOR EQUAL 10)
if(WINAPI_VER_MINOR EQUAL 0)
if(WINAPI_VER_BUILD GREATER_EQUAL 20348)
set(WINAPI_COMPATIBLE TRUE)
endif()
else()
set(WINAPI_COMPATIBLE TRUE)
endif()
elseif(WINAPI_VER_MAJOR GREATER 10)
set(WINAPI_COMPATIBLE TRUE)
endif()
if(NOT WINAPI_COMPATIBLE)
message(
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."
)
endif()
add_compile_options(
/MP
/W3
/wd4127
/wd4201
/wd4456
/wd4457
/wd4458
/wd4459
/wd4595
"$<$<CONFIG:DEBUG>:/DDEBUG=1;/D_DEBUG=1>"
"$<$<CONFIG:RELWITHDEBINFO>:/Ob2>"
/DUNICODE
/D_UNICODE
/D_CRT_SECURE_NO_WARNINGS
/D_CRT_NONSTDC_NO_WARNINGS)
add_link_options(
"LINKER:/OPT:REF"
"$<$<NOT:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>>:LINKER\:/SAFESEH\:NO>"
"$<$<CONFIG:DEBUG>:LINKER\:/INCREMENTAL\:NO>"
"$<$<CONFIG:RELWITHDEBINFO>:LINKER\:/INCREMENTAL\:NO;/OPT:ICF>")
else()
find_program(CCACHE_PROGRAM "ccache")
set(CCACHE_SUPPORT
ON
CACHE BOOL "Enable ccache support")
mark_as_advanced(CCACHE_PROGRAM)
if(CCACHE_PROGRAM AND CCACHE_SUPPORT)
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_OBJC_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_OBJCXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") # CMake 3.9+
endif()
add_compile_options(
-Wextra
-Wvla
-Wno-unused-function
-Wno-missing-field-initializers
-fno-strict-aliasing
"$<$<COMPILE_LANGUAGE:C>:-Werror-implicit-function-declaration;-Wno-missing-braces>"
"$<$<BOOL:${USE_LIBCXX}>:-stdlib=libc++>"
"$<$<CONFIG:DEBUG>:-DDEBUG=1;-D_DEBUG=1>"
"$<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang>:-fcolor-diagnostics>"
"$<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang>:-fcolor-diagnostics>")
if(OBS_CODESIGN_LINKER)
add_link_options("LINKER:$<$<PLATFORM_ID:Darwin>:-adhoc_codesign>")
endif()
if(MINGW)
set(CMAKE_WIDL
"widl"
CACHE INTERNAL "wine IDL header file generation program")
add_compile_definitions("_WIN32_WINNT=0x0600;WINVER=0x0600")
endif()
endif()
if(MSVC_CXX_ARCHITECTURE_ID)
string(TOLOWER ${MSVC_CXX_ARCHITECTURE_ID} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
else()
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
endif()
if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES
"(i[3-6]86|x86|x64|x86_64|amd64|e2k)")
if(NOT MSVC AND NOT CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
set(ARCH_SIMD_FLAGS -mmmx -msse -msse2)
endif()
elseif(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64(le)?")
set(ARCH_SIMD_DEFINES -DNO_WARN_X86_INTRINSICS)
set(ARCH_SIMD_FLAGS -mvsx)
else()
if(CMAKE_C_COMPILER_ID MATCHES "^(Apple)?Clang|GNU"
OR CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang|GNU")
check_c_compiler_flag("-fopenmp-simd" C_COMPILER_SUPPORTS_OPENMP_SIMD)
check_cxx_compiler_flag("-fopenmp-simd" CXX_COMPILER_SUPPORTS_OPENMP_SIMD)
set(ARCH_SIMD_FLAGS
-DSIMDE_ENABLE_OPENMP
"$<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:C_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>"
"$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:CXX_COMPILER_SUPPORTS_OPENMP_SIMD>>:-fopenmp-simd>"
)
endif()
endif()
if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "e2k")
foreach(
TEST_C_FLAG
"-Wno-unused-parameter"
"-Wno-ignored-qualifiers"
"-Wno-pointer-sign"
"-Wno-unused-variable"
"-Wno-sign-compare"
"-Wno-bad-return-value-type"
"-Wno-maybe-uninitialized")
check_c_compiler_flag(${TEST_C_FLAG}
C_COMPILER_SUPPORTS_FLAG_${TEST_C_FLAG})
if(C_COMPILER_SUPPORTS_FLAG_${TEST_C_FLAG})
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ${TEST_C_FLAG})
endif()
endforeach()
foreach(TEST_CXX_FLAG "-Wno-invalid-offsetof" "-Wno-maybe-uninitialized")
check_cxx_compiler_flag(${TEST_CXX_FLAG}
CXX_COMPILER_SUPPORTS_FLAG_${TEST_CXX_FLAG})
if(CXX_COMPILER_SUPPORTS_FLAG_${TEST_CXX_FLAG})
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${TEST_CXX_FLAG})
endif()
endforeach()
endif()

View File

@ -1,279 +1,290 @@
# Doesn't really make sense anywhere else
if(NOT MSVC)
return()
return()
endif()
# Internal variable to avoid copying more than once
if(COPIED_DEPENDENCIES)
return()
return()
endif()
option(COPY_DEPENDENCIES "Automatically try copying all dependencies" ON)
if(NOT COPY_DEPENDENCIES)
return()
return()
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_bin_suffix 64)
set(_bin_suffix 64)
else()
set(_bin_suffix 32)
set(_bin_suffix 32)
endif()
file(GLOB FFMPEG_BIN_FILES
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/avcodec-*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/avcodec-*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/avcodec-*.dll"
file(
GLOB
FFMPEG_BIN_FILES
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/avcodec-*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/avcodec-*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/avcodec-*.dll"
"${FFMPEG_avformat_INCLUDE_DIR}/../bin/avformat-*.dll"
"${FFMPEG_avformat_INCLUDE_DIR}/../bin${_bin_suffix}/avformat-*.dll"
"${FFMPEG_avformat_INCLUDE_DIR}/bin${_bin_suffix}/avformat-*.dll"
"${FFMPEG_avutil_INCLUDE_DIR}/../bin/avutil-*.dll"
"${FFMPEG_avutil_INCLUDE_DIR}/../bin${_bin_suffix}/avutil-*.dll"
"${FFMPEG_avutil_INCLUDE_DIR}/bin${_bin_suffix}/avutil-*.dll"
"${FFMPEG_avdevice_INCLUDE_DIR}/../bin/avdevice-*.dll"
"${FFMPEG_avdevice_INCLUDE_DIR}/../bin${_bin_suffix}/avdevice-*.dll"
"${FFMPEG_avdevice_INCLUDE_DIR}/bin${_bin_suffix}/avdevice-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin/avfilter-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin${_bin_suffix}/avfilter-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/bin${_bin_suffix}/avfilter-*.dll"
"${FFMPEG_postproc_INCLUDE_DIR}/../bin/postproc-*.dll"
"${FFMPEG_postproc_INCLUDE_DIR}/../bin${_bin_suffix}/postproc-*.dll"
"${FFMPEG_postproc_INCLUDE_DIR}/bin${_bin_suffix}/postproc-*.dll"
"${FFMPEG_swscale_INCLUDE_DIR}/../bin/swscale-*.dll"
"${FFMPEG_swscale_INCLUDE_DIR}/bin${_bin_suffix}/swscale-*.dll"
"${FFMPEG_swscale_INCLUDE_DIR}/../bin${_bin_suffix}/swscale-*.dll"
"${FFMPEG_swresample_INCLUDE_DIR}/../bin/swresample-*.dll"
"${FFMPEG_swresample_INCLUDE_DIR}/../bin${_bin_suffix}/swresample-*.dll"
"${FFMPEG_swresample_INCLUDE_DIR}/bin${_bin_suffix}/swresample-*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libopus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/opus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libopus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/opus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libogg*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libvorbis*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libogg*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libvorbis*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libvpx*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libvpx*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libsrt*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libsrt*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libmbedcrypto*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libmbedcrypto*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libmbedtls*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libmbedtls*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libmbedx509*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libmbedx509*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libopus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/opus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libopus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/opus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libbz2*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/zlib*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libbz2*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/zlib*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libSvtAv1Enc.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libSvtAv1Enc.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libSvtAv1Enc.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libSvtAv1Enc.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libaom.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libaom.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libaom.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libaom.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/librist.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/librist.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/librist.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/librist.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libbz2*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/zlib*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libbz2*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/zlib*.dll")
"${FFMPEG_avformat_INCLUDE_DIR}/../bin/avformat-*.dll"
"${FFMPEG_avformat_INCLUDE_DIR}/../bin${_bin_suffix}/avformat-*.dll"
"${FFMPEG_avformat_INCLUDE_DIR}/bin${_bin_suffix}/avformat-*.dll"
file(
GLOB
X264_BIN_FILES
"${X264_INCLUDE_DIR}/../bin${_bin_suffix}/libx264-*.dll"
"${X264_INCLUDE_DIR}/../bin/libx264-*.dll"
"${X264_INCLUDE_DIR}/bin/libx264-*.dll"
"${X264_INCLUDE_DIR}/bin${_bin_suffix}/libx264-*.dll")
"${FFMPEG_avutil_INCLUDE_DIR}/../bin/avutil-*.dll"
"${FFMPEG_avutil_INCLUDE_DIR}/../bin${_bin_suffix}/avutil-*.dll"
"${FFMPEG_avutil_INCLUDE_DIR}/bin${_bin_suffix}/avutil-*.dll"
file(
GLOB
FREETYPE_BIN_FILES
"${FREETYPE_INCLUDE_DIR_ft2build}/../../bin${_bin_suffix}/libfreetype*-*.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/../../bin/libfreetype*-*.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/../bin${_bin_suffix}/libfreetype*-*.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/../bin/libfreetype*-*.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/bin/libfreetype*-*.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/bin${_bin_suffix}/libfreetype*-*.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/../../bin${_bin_suffix}/freetype.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/../../bin/freetype.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/../bin${_bin_suffix}/freetype.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/../bin/freetype.dll")
"${FFMPEG_avdevice_INCLUDE_DIR}/../bin/avdevice-*.dll"
"${FFMPEG_avdevice_INCLUDE_DIR}/../bin${_bin_suffix}/avdevice-*.dll"
"${FFMPEG_avdevice_INCLUDE_DIR}/bin${_bin_suffix}/avdevice-*.dll"
file(
GLOB
LIBFDK_BIN_FILES
"${Libfdk_INCLUDE_DIR}/../bin${_bin_suffix}/libfdk*-*.dll"
"${Libfdk_INCLUDE_DIR}/../bin/libfdk*-*.dll"
"${Libfdk_INCLUDE_DIR}/bin/libfdk*-*.dll"
"${Libfdk_INCLUDE_DIR}/bin${_bin_suffix}/libfdk*-*.dll")
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin/avfilter-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin${_bin_suffix}/avfilter-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/bin${_bin_suffix}/avfilter-*.dll"
file(
GLOB
SSL_BIN_FILES
"${SSL_INCLUDE_DIR}/../bin${_bin_suffix}/ssleay32*.dll"
"${SSL_INCLUDE_DIR}/../bin${_bin_suffix}/libeay32*.dll"
"${SSL_INCLUDE_DIR}/../bin/ssleay32*.dll"
"${SSL_INCLUDE_DIR}/../bin/libeay32*.dll"
"${SSL_INCLUDE_DIR}/bin${_bin_suffix}/ssleay32*.dll"
"${SSL_INCLUDE_DIR}/bin${_bin_suffix}/libeay32*.dll"
"${SSL_INCLUDE_DIR}/bin/ssleay32*.dll"
"${SSL_INCLUDE_DIR}/bin/libeay32*.dll")
"${FFMPEG_postproc_INCLUDE_DIR}/../bin/postproc-*.dll"
"${FFMPEG_postproc_INCLUDE_DIR}/../bin${_bin_suffix}/postproc-*.dll"
"${FFMPEG_postproc_INCLUDE_DIR}/bin${_bin_suffix}/postproc-*.dll"
file(
GLOB
CURL_BIN_FILES
"${CURL_INCLUDE_DIR}/../build/Win${_bin_suffix}/VC12/DLL Release - DLL Windows SSPI/libcurl.dll"
"${CURL_INCLUDE_DIR}/../bin${_bin_suffix}/libcurl*.dll"
"${CURL_INCLUDE_DIR}/../bin${_bin_suffix}/curl*.dll"
"${CURL_INCLUDE_DIR}/../bin/libcurl*.dll"
"${CURL_INCLUDE_DIR}/../bin/curl*.dll"
"${CURL_INCLUDE_DIR}/bin${_bin_suffix}/libcurl*.dll"
"${CURL_INCLUDE_DIR}/bin${_bin_suffix}/curl*.dll"
"${CURL_INCLUDE_DIR}/bin/libcurl*.dll"
"${CURL_INCLUDE_DIR}/bin/curl*.dll")
"${FFMPEG_swscale_INCLUDE_DIR}/../bin/swscale-*.dll"
"${FFMPEG_swscale_INCLUDE_DIR}/bin${_bin_suffix}/swscale-*.dll"
"${FFMPEG_swscale_INCLUDE_DIR}/../bin${_bin_suffix}/swscale-*.dll"
file(
GLOB
LUA_BIN_FILES
"${LUAJIT_INCLUDE_DIR}/../../bin${_bin_suffix}/lua*.dll"
"${LUAJIT_INCLUDE_DIR}/../../bin/lua*.dll"
"${LUAJIT_INCLUDE_DIR}/../bin${_bin_suffix}/lua*.dll"
"${LUAJIT_INCLUDE_DIR}/../bin/lua*.dll"
"${LUAJIT_INCLUDE_DIR}/bin${_bin_suffix}/lua*.dll"
"${LUAJIT_INCLUDE_DIR}/bin/lua*.dll"
"${LUAJIT_INCLUDE_DIR}/lua*.dll")
"${FFMPEG_swresample_INCLUDE_DIR}/../bin/swresample-*.dll"
"${FFMPEG_swresample_INCLUDE_DIR}/../bin${_bin_suffix}/swresample-*.dll"
"${FFMPEG_swresample_INCLUDE_DIR}/bin${_bin_suffix}/swresample-*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libopus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/opus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libopus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/opus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libogg*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libvorbis*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libogg*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libvorbis*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libvpx*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libvpx*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libsrt*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libsrt*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libmbedcrypto*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libmbedcrypto*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libmbedtls*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libmbedtls*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libmbedx509*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libmbedx509*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libopus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/opus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libopus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/opus*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libbz2*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/zlib*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libbz2*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/zlib*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libSvtAv1Enc.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libSvtAv1Enc.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libSvtAv1Enc.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libSvtAv1Enc.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libaom.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libaom.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libaom.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libaom.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/librist.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/librist.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/librist.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/librist.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libbz2*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/zlib*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libbz2*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/zlib*.dll"
)
file(GLOB X264_BIN_FILES
"${X264_INCLUDE_DIR}/../bin${_bin_suffix}/libx264-*.dll"
"${X264_INCLUDE_DIR}/../bin/libx264-*.dll"
"${X264_INCLUDE_DIR}/bin/libx264-*.dll"
"${X264_INCLUDE_DIR}/bin${_bin_suffix}/libx264-*.dll")
file(GLOB FREETYPE_BIN_FILES
"${FREETYPE_INCLUDE_DIR_ft2build}/../../bin${_bin_suffix}/libfreetype*-*.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/../../bin/libfreetype*-*.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/../bin${_bin_suffix}/libfreetype*-*.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/../bin/libfreetype*-*.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/bin/libfreetype*-*.dll"
"${FREETYPE_INCLUDE_DIR_ft2build}/bin${_bin_suffix}/libfreetype*-*.dll")
file(GLOB LIBFDK_BIN_FILES
"${Libfdk_INCLUDE_DIR}/../bin${_bin_suffix}/libfdk*-*.dll"
"${Libfdk_INCLUDE_DIR}/../bin/libfdk*-*.dll"
"${Libfdk_INCLUDE_DIR}/bin/libfdk*-*.dll"
"${Libfdk_INCLUDE_DIR}/bin${_bin_suffix}/libfdk*-*.dll")
file(GLOB SSL_BIN_FILES
"${SSL_INCLUDE_DIR}/../bin${_bin_suffix}/ssleay32*.dll"
"${SSL_INCLUDE_DIR}/../bin${_bin_suffix}/libeay32*.dll"
"${SSL_INCLUDE_DIR}/../bin/ssleay32*.dll"
"${SSL_INCLUDE_DIR}/../bin/libeay32*.dll"
"${SSL_INCLUDE_DIR}/bin${_bin_suffix}/ssleay32*.dll"
"${SSL_INCLUDE_DIR}/bin${_bin_suffix}/libeay32*.dll"
"${SSL_INCLUDE_DIR}/bin/ssleay32*.dll"
"${SSL_INCLUDE_DIR}/bin/libeay32*.dll")
file(GLOB CURL_BIN_FILES
"${CURL_INCLUDE_DIR}/../build/Win${_bin_suffix}/VC12/DLL Release - DLL Windows SSPI/libcurl.dll"
"${CURL_INCLUDE_DIR}/../bin${_bin_suffix}/libcurl*.dll"
"${CURL_INCLUDE_DIR}/../bin${_bin_suffix}/curl*.dll"
"${CURL_INCLUDE_DIR}/../bin/libcurl*.dll"
"${CURL_INCLUDE_DIR}/../bin/curl*.dll"
"${CURL_INCLUDE_DIR}/bin${_bin_suffix}/libcurl*.dll"
"${CURL_INCLUDE_DIR}/bin${_bin_suffix}/curl*.dll"
"${CURL_INCLUDE_DIR}/bin/libcurl*.dll"
"${CURL_INCLUDE_DIR}/bin/curl*.dll"
)
file(GLOB LUA_BIN_FILES
"${LUAJIT_INCLUDE_DIR}/../../bin${_bin_suffix}/lua*.dll"
"${LUAJIT_INCLUDE_DIR}/../../bin/lua*.dll"
"${LUAJIT_INCLUDE_DIR}/../bin${_bin_suffix}/lua*.dll"
"${LUAJIT_INCLUDE_DIR}/../bin/lua*.dll"
"${LUAJIT_INCLUDE_DIR}/bin${_bin_suffix}/lua*.dll"
"${LUAJIT_INCLUDE_DIR}/bin/lua*.dll"
"${LUAJIT_INCLUDE_DIR}/lua*.dll"
)
if (ZLIB_LIB)
GET_FILENAME_COMPONENT(ZLIB_BIN_PATH ${ZLIB_LIB} PATH)
if(ZLIB_LIB)
get_filename_component(ZLIB_BIN_PATH ${ZLIB_LIB} PATH)
endif()
file(GLOB ZLIB_BIN_FILES
"${ZLIB_BIN_PATH}/zlib*.dll")
file(GLOB ZLIB_BIN_FILES "${ZLIB_BIN_PATH}/zlib*.dll")
if (NOT ZLIB_BIN_FILES)
file(GLOB ZLIB_BIN_FILES
"${ZLIB_INCLUDE_DIR}/../bin${_bin_suffix}/zlib*.dll"
"${ZLIB_INCLUDE_DIR}/../bin/zlib*.dll"
"${ZLIB_INCLUDE_DIR}/bin${_bin_suffix}/zlib*.dll"
"${ZLIB_INCLUDE_DIR}/bin/zlib*.dll"
)
if(NOT ZLIB_BIN_FILES)
file(
GLOB
ZLIB_BIN_FILES
"${ZLIB_INCLUDE_DIR}/../bin${_bin_suffix}/zlib*.dll"
"${ZLIB_INCLUDE_DIR}/../bin/zlib*.dll"
"${ZLIB_INCLUDE_DIR}/bin${_bin_suffix}/zlib*.dll"
"${ZLIB_INCLUDE_DIR}/bin/zlib*.dll")
endif()
file(GLOB QT_DEBUG_BIN_FILES
"${Qt5Core_DIR}/../../../bin/Qt5Cored.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Guid.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Widgetsd.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Svgd.dll"
"${Qt5Core_DIR}/../../../bin/Qt5WinExtrasd.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Xmld.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Networkd.dll"
"${Qt5Core_DIR}/../../../bin/libGLESv2d.dll"
"${Qt5Core_DIR}/../../../bin/libEGLd.dll")
file(GLOB RNNOISE_BIN_FILES
"${RNNOISE_INCLUDE_DIR}/../bin${_bin_suffix}/rnnoise*.dll"
"${RNNOISE_INCLUDE_DIR}/../bin/rnnoise*.dll")
file(
GLOB
QT_DEBUG_BIN_FILES
"${Qt5Core_DIR}/../../../bin/Qt5Cored.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Guid.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Widgetsd.dll"
"${Qt5Core_DIR}/../../../bin/Qt5WinExtrasd.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Svgd.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Xmld.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Networkd.dll"
"${Qt5Core_DIR}/../../../bin/libGLESv2d.dll"
"${Qt5Core_DIR}/../../../bin/libEGLd.dll")
file(GLOB QT_DEBUG_PLAT_BIN_FILES
"${Qt5Core_DIR}/../../../plugins/platforms/qwindowsd.dll")
"${Qt5Core_DIR}/../../../plugins/platforms/qwindowsd.dll")
file(GLOB QT_DEBUG_STYLES_BIN_FILES
"${Qt5Core_DIR}/../../../plugins/styles/qwindowsvistastyled.dll")
"${Qt5Core_DIR}/../../../plugins/styles/qwindowsvistastyled.dll")
file(GLOB QT_DEBUG_ICONENGINE_BIN_FILES
"${Qt5Core_DIR}/../../../plugins/iconengines/qsvgicond.dll")
file(GLOB QT_DEBUG_IMAGEFORMATS_BIN_FILES
"${Qt5Core_DIR}/../../../plugins/imageformats/qsvgd.dll"
"${Qt5Core_DIR}/../../../plugins/imageformats/qgifd.dll"
"${Qt5Core_DIR}/../../../plugins/imageformats/qjpegd.dll")
"${Qt5Core_DIR}/../../../plugins/iconengines/qsvgicond.dll")
file(
GLOB
QT_DEBUG_IMAGEFORMATS_BIN_FILES
"${Qt5Core_DIR}/../../../plugins/imageformats/qsvgd.dll"
"${Qt5Core_DIR}/../../../plugins/imageformats/qgifd.dll"
"${Qt5Core_DIR}/../../../plugins/imageformats/qjpegd.dll")
file(GLOB QT_BIN_FILES
"${Qt5Core_DIR}/../../../bin/Qt5Core.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Gui.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Widgets.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Svg.dll"
"${Qt5Core_DIR}/../../../bin/Qt5WinExtras.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Xml.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Network.dll"
"${Qt5Core_DIR}/../../../bin/libGLESv2.dll"
"${Qt5Core_DIR}/../../../bin/libEGL.dll")
file(
GLOB
QT_BIN_FILES
"${Qt5Core_DIR}/../../../bin/Qt5Core.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Gui.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Widgets.dll"
"${Qt5Core_DIR}/../../../bin/Qt5WinExtras.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Svg.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Xml.dll"
"${Qt5Core_DIR}/../../../bin/Qt5Network.dll"
"${Qt5Core_DIR}/../../../bin/libGLESv2.dll"
"${Qt5Core_DIR}/../../../bin/libEGL.dll")
file(GLOB QT_PLAT_BIN_FILES
"${Qt5Core_DIR}/../../../plugins/platforms/qwindows.dll")
"${Qt5Core_DIR}/../../../plugins/platforms/qwindows.dll")
file(GLOB QT_STYLES_BIN_FILES
"${Qt5Core_DIR}/../../../plugins/styles/qwindowsvistastyle.dll")
"${Qt5Core_DIR}/../../../plugins/styles/qwindowsvistastyle.dll")
file(GLOB QT_ICONENGINE_BIN_FILES
"${Qt5Core_DIR}/../../../plugins/iconengines/qsvgicon.dll")
file(GLOB QT_IMAGEFORMATS_BIN_FILES
"${Qt5Core_DIR}/../../../plugins/imageformats/qsvg.dll"
"${Qt5Core_DIR}/../../../plugins/imageformats/qgif.dll"
"${Qt5Core_DIR}/../../../plugins/imageformats/qjpeg.dll")
"${Qt5Core_DIR}/../../../plugins/iconengines/qsvgicon.dll")
file(
GLOB
QT_IMAGEFORMATS_BIN_FILES
"${Qt5Core_DIR}/../../../plugins/imageformats/qsvg.dll"
"${Qt5Core_DIR}/../../../plugins/imageformats/qgif.dll"
"${Qt5Core_DIR}/../../../plugins/imageformats/qjpeg.dll")
file(GLOB QT_ICU_BIN_FILES
"${Qt5Core_DIR}/../../../bin/icu*.dll")
file(GLOB QT_ICU_BIN_FILES "${Qt5Core_DIR}/../../../bin/icu*.dll")
set(ALL_BASE_BIN_FILES
${FFMPEG_BIN_FILES}
${X264_BIN_FILES}
${CURL_BIN_FILES}
${LUA_BIN_FILES}
${SSL_BIN_FILES}
${ZLIB_BIN_FILES}
${LIBFDK_BIN_FILES}
${FREETYPE_BIN_FILES}
${QT_ICU_BIN_FILES})
${FFMPEG_BIN_FILES}
${X264_BIN_FILES}
${CURL_BIN_FILES}
${LUA_BIN_FILES}
${SSL_BIN_FILES}
${ZLIB_BIN_FILES}
${LIBFDK_BIN_FILES}
${FREETYPE_BIN_FILES}
${RNNOISE_BIN_FILES}
${QT_ICU_BIN_FILES})
set(ALL_REL_BIN_FILES
${QT_BIN_FILES})
set(ALL_REL_BIN_FILES ${QT_BIN_FILES})
set(ALL_DBG_BIN_FILES
${QT_DEBUG_BIN_FILES})
set(ALL_DBG_BIN_FILES ${QT_DEBUG_BIN_FILES})
set(ALL_PLATFORM_BIN_FILES)
set(ALL_PLATFORM_REL_BIN_FILES
${QT_PLAT_BIN_FILES})
set(ALL_PLATFORM_DBG_BIN_FILES
${QT_DEBUG_PLAT_BIN_FILES})
set(ALL_PLATFORM_REL_BIN_FILES ${QT_PLAT_BIN_FILES})
set(ALL_PLATFORM_DBG_BIN_FILES ${QT_DEBUG_PLAT_BIN_FILES})
set(ALL_STYLES_BIN_FILES)
set(ALL_STYLES_REL_BIN_FILES
${QT_STYLES_BIN_FILES})
set(ALL_STYLES_DBG_BIN_FILES
${QT_DEBUG_STYLES_BIN_FILES})
set(ALL_STYLES_REL_BIN_FILES ${QT_STYLES_BIN_FILES})
set(ALL_STYLES_DBG_BIN_FILES ${QT_DEBUG_STYLES_BIN_FILES})
set(ALL_ICONENGINE_BIN_FILES)
set(ALL_ICONENGINE_REL_BIN_FILES
${QT_ICONENGINE_BIN_FILES})
set(ALL_ICONENGINE_DBG_BIN_FILES
${QT_DEBUG_ICONENGINE_BIN_FILES})
set(ALL_ICONENGINE_REL_BIN_FILES ${QT_ICONENGINE_BIN_FILES})
set(ALL_ICONENGINE_DBG_BIN_FILES ${QT_DEBUG_ICONENGINE_BIN_FILES})
set(ALL_IMAGEFORMATS_BIN_FILES)
set(ALL_IMAGEFORMATS_REL_BIN_FILES
${QT_IMAGEFORMATS_BIN_FILES})
set(ALL_IMAGEFORMATS_DBG_BIN_FILES
${QT_DEBUG_IMAGEFORMATS_BIN_FILES})
set(ALL_IMAGEFORMATS_REL_BIN_FILES ${QT_IMAGEFORMATS_BIN_FILES})
set(ALL_IMAGEFORMATS_DBG_BIN_FILES ${QT_DEBUG_IMAGEFORMATS_BIN_FILES})
foreach(list
ALL_BASE_BIN_FILES ALL_REL_BIN_FILES ALL_DBG_BIN_FILES
ALL_PLATFORM_BIN_FILES ALL_PLATFORM_REL_BIN_FILES ALL_PLATFORM_DBG_BIN_FILES
ALL_STYLES_BIN_FILES ALL_STYLES_REL_BIN_FILES ALL_STYLES_DBG_BIN_FILES
ALL_ICONENGINE_BIN_FILES ALL_ICONENGINE_REL_BIN_FILES ALL_ICONENGINE_DGB_BIN_FILES
ALL_IMAGEFORMATS_BIN_FILES ALL_IMAGEFORMATS_REL_BIN_FILES ALL_IMAGEFORMATS_DGB_BIN_FILES)
if(${list})
list(REMOVE_DUPLICATES ${list})
endif()
foreach(
list
ALL_BASE_BIN_FILES
ALL_REL_BIN_FILES
ALL_DBG_BIN_FILES
ALL_PLATFORM_BIN_FILES
ALL_PLATFORM_REL_BIN_FILES
ALL_PLATFORM_DBG_BIN_FILES
ALL_STYLES_BIN_FILES
ALL_STYLES_REL_BIN_FILES
ALL_STYLES_DBG_BIN_FILES
ALL_ICONENGINE_BIN_FILES
ALL_ICONENGINE_REL_BIN_FILES
ALL_ICONENGINE_DGB_BIN_FILES
ALL_IMAGEFORMATS_BIN_FILES
ALL_IMAGEFORMATS_REL_BIN_FILES
ALL_IMAGEFORMATS_DGB_BIN_FILES)
if(${list})
list(REMOVE_DUPLICATES ${list})
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}")
@ -291,78 +302,166 @@ message(STATUS "QT Release Imageformat files: ${QT_IMAGEFORMATS_BIN_FILES}")
message(STATUS "QT ICU files: ${QT_ICU_BIN_FILES}")
foreach(BinFile ${ALL_BASE_BIN_FILES})
message(STATUS "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/")
message(
STATUS
"copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}"
)
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/")
endforeach()
foreach(BinFile ${ALL_REL_BIN_FILES})
message(STATUS "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/")
message(
STATUS
"copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r"
)
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/")
endforeach()
foreach(BinFile ${ALL_DBG_BIN_FILES})
message(STATUS "copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/")
message(
STATUS
"copying ${BinFile} to ${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d"
)
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/")
endforeach()
foreach(BinFile ${ALL_PLATFORM_BIN_FILES})
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/platforms")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/platforms/")
make_directory(
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/platforms")
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/platforms/"
)
endforeach()
foreach(BinFile ${ALL_PLATFORM_REL_BIN_FILES})
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/platforms")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/platforms/")
make_directory(
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/platforms"
)
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/platforms/"
)
endforeach()
foreach(BinFile ${ALL_PLATFORM_DBG_BIN_FILES})
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/platforms")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/platforms/")
make_directory(
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/platforms"
)
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/platforms/"
)
endforeach()
foreach(BinFile ${ALL_STYLES_BIN_FILES})
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/styles")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/styles/")
make_directory(
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/styles")
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/styles/")
endforeach()
foreach(BinFile ${ALL_STYLES_REL_BIN_FILES})
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/styles")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/styles/")
make_directory(
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/styles")
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/styles/"
)
endforeach()
foreach(BinFile ${ALL_STYLES_DBG_BIN_FILES})
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/styles")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/styles/")
make_directory(
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/styles")
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/styles/"
)
endforeach()
foreach(BinFile ${ALL_ICONENGINE_BIN_FILES})
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/iconengines")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/iconengines/")
make_directory(
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/iconengines"
)
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/iconengines/"
)
endforeach()
foreach(BinFile ${ALL_ICONENGINE_REL_BIN_FILES})
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/iconengines")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/iconengines/")
make_directory(
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/iconengines"
)
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/iconengines/"
)
endforeach()
foreach(BinFile ${ALL_ICONENGINE_DBG_BIN_FILES})
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/iconengines")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/iconengines/")
make_directory(
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/iconengines"
)
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/iconengines/"
)
endforeach()
foreach(BinFile ${ALL_IMAGEFORMATS_BIN_FILES})
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/imageformats")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/imageformats/")
make_directory(
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/imageformats"
)
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}/imageformats/"
)
endforeach()
foreach(BinFile ${ALL_IMAGEFORMATS_REL_BIN_FILES})
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/imageformats")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/imageformats/")
make_directory(
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/imageformats"
)
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}r/imageformats/"
)
endforeach()
foreach(BinFile ${ALL_IMAGEFORMATS_DBG_BIN_FILES})
make_directory("${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/imageformats")
file(COPY "${BinFile}" DESTINATION "${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/imageformats/")
make_directory(
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/imageformats"
)
file(
COPY "${BinFile}"
DESTINATION
"${CMAKE_SOURCE_DIR}/additional_install_files/exec${_bin_suffix}d/imageformats/"
)
endforeach()
set(COPIED_DEPENDENCIES TRUE CACHE BOOL "Dependencies have been copied, set to false to copy again" FORCE)
set(COPIED_DEPENDENCIES
TRUE
CACHE BOOL "Dependencies have been copied, set to false to copy again"
FORCE)

View File

@ -0,0 +1,242 @@
function(upgrade_cmake_vars)
if(DEFINED BROWSER_LEGACY)
set(ENABLE_BROWSER_LEGACY
"${BROWSER_LEGACY}"
CACHE BOOL "" FORCE)
endif()
if(DEFINED BROWSER_PANEL_SUPPORT_ENABLED)
set(ENABLE_BROWSER_PANELS
"${BROWSER_PANEL_SUPPORT_ENABLED}"
CACHE BOOL "" FORCE)
endif()
if(DEFINED BUILD_BROWSER)
set(ENABLE_BROWSER
"${BUILD_BROWSER}"
CACHE BOOL "" FORCE)
endif()
if(DEFINED BUILD_CA_ENCODER)
set(ENABLE_COREAUDIO_ENCODER
"${BUILD_CA_ENCODER}"
CACHE BOOL "" FORCE)
endif()
if(DEFINED BUILD_VST)
set(ENABLE_VST
"${BUILD_VST}"
CACHE BOOL "" FORCE)
endif()
if(DEFINED CHECK_FOR_SERVICE_UPDATES)
set(ENABLE_SERVICE_UPDATES
"${CHECK_FOR_SERVICE_UPDATES}"
CACHE BOOL "" FORCE)
endif()
if(DEFINED DEBUG_FFMPEG_MUX)
set(ENABLE_FFMPEG_MUX_DEBUG
"${DEBUG_FFMPEG_MUX}"
CACHE BOOL "" FORCE)
endif()
if(DEFINED DISABLE_IVCAM)
if(DISABLE_IVCAM)
set(ENABLE_IVCAM
OFF
CACHE BOOL "" FORCE)
else()
set(ENABLE_IVCAM
ON
CACHE BOOL "" FORCE)
endif()
endif()
if(DEFINED DISABLE_PLUGINS)
if(DISABLE_PLUGINS)
set(ENABLE_PLUGINS
OFF
CACHE BOOL "" FORCE)
else()
set(ENABLE_PLUGINS
ON
CACHE BOOL "" FORCE)
endif()
endif()
if(DEFINED DISABLE_PYTHON)
if(DISABLE_PYTHON)
set(ENABLE_SCRIPTING_PYTHON
OFF
CACHE BOOL "" FORCE)
else()
set(ENABLE_SCRIPTING_PYTHON
ON
CACHE BOOL "" FORCE)
endif()
endif()
if(DEFINED DISABLE_LUA)
if(DISABLE_LUA)
set(ENABLE_SCRIPTING_LUA
OFF
CACHE BOOL "" FORCE)
else()
set(ENABLE_SCRIPTING_LUA
ON
CACHE BOOL "" FORCE)
endif()
endif()
if(DEFINED DISABLE_SPEEXDSP)
if(DISABLE_SPEEXDSP)
set(ENABLE_SPEEXDSP
OFF
CACHE BOOL "" FORCE)
else()
set(ENABLE_SPEEXDSP
ON
CACHE BOOL "" FORCE)
endif()
endif()
if(DEFINED DISABLE_UPDATE_MODULE)
if(DISABLE_UPDATE_MODULE)
set(ENABLE_UPDATER
OFF
CACHE BOOL "" FORCE)
else()
set(ENABLE_UPDATER
ON
CACHE BOOL "" FORCE)
endif()
endif()
if(DEFINED SHARED_TEXTURE_SUPPORT_ENABLED)
set(ENABLE_BROWSER_SHARED_TEXTURE
"${SHARED_TEXTURE_SUPPORT_ENABLED}"
CACHE BOOL "" FORCE)
endif()
if(DEFINED STATIC_MBEDTLS)
set(ENABLE_STATIC_MBEDTLS
"${STATIC_MBEDTLS}"
CACHE BOOL "" FORCE)
endif()
if(DEFINED UNIX_STRUCTURE AND UNIX_STRUCTURE)
set(LINUX_PORTABLE
OFF
CACHE BOOL "" FORCE)
endif()
if(DEFINED USE_QT_LOOP)
set(ENABLE_BROWSER_QT_LOOP
"${USE_QT_LOOP}"
CACHE BOOL "" FORCE)
endif()
if(DEFINED WITH_RTMPS)
set(ENABLE_RTMPS
"${WITH_RTMPS}"
CACHE STRING "" FORCE)
endif()
endfunction()
function(install_obs_plugin_with_data)
message(
DEPRECATION
"OBS: 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(
DEPRECATION
"OBS: 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(
DEPRECATION
"OBS: 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!")
endif()
endfunction()
function(__deprecated_feature VAR ACCESS)
if(ACCESS STREQUAL "UNKNOWN_READ_ACCESS")
message(
DEPRECATION
"OBS: The feature enabled by '${VAR}' is deprecated and will soon be removed from OBS."
)
endif()
endfunction()
set(_DEPRECATED_VARS
zlibPath
vulkanPath
SwigPath
PythonPath
mbedtlsPath
LuajitPath
x264Path
VlcPath
VLCPath
speexPath
rnnoisePath
LibfdkPath
curlPath
JanssonPath
FFmpegPath
DepsPath
DepsPath32
DepsPath64
QTDIR32
QTDIR64
DISABLE_UI
UI_ENABLED
UNIX_STRUCTURE
UPDATE_SPARKLE
LIBOBS_PREFER_IMAGEMAGICK
DEBUG_FFMPEG_MUX
ENABLE_WINMF
USE_QT_LOOP
SHARED_TEXTURE_SUPPORT_ENABLED
BROWSER_PANEL_SUPPORT_ENABLED
BROWSER_LEGACY
BUILD_BROWSER
BUILD_CAPTIONS
BUILD_CA_ENCODER
BUILD_VST
CHECK_FOR_SERVICE_UPDATES
DISABLE_IVCAM
DISABLE_LUA
DISABLE_PLUGINS
DISABLE_PYTHON
DISABLE_SPEEXDSP
DISABLE_UPDATE_MODULE
SHARED_TEXTURE_SUPPORT_ENABLED
STATIC_MBEDTLS
UNIX_STRUCTURE
USE_QT_LOOP
WITH_RTMPS)
foreach(_DEPRECATED_VAR IN LISTS _DEPRECATED_VARS)
variable_watch(_DEPRECATED_VAR __deprecated_var)
endforeach()
variable_watch(FTL_FOUND __deprecated_feature)
# Upgrade pre-existing build variables to their new variants as best as possible
upgrade_cmake_vars()

View File

@ -1,12 +0,0 @@
# Once done these will be defined:
#
# APPKIT_FOUND
# APPKIT_LIBRARIES
find_library(APPKIT_FRAMEWORK AppKit)
set(APPKIT_LIBRARIES ${APPKIT_FRAMEWORK})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(AppKit DEFAULT_MSG APPKIT_FRAMEWORK)
mark_as_advanced(APPKIT_FRAMEWORK)

160
cmake/Modules/FindCEF.cmake Normal file
View File

@ -0,0 +1,160 @@
include(FindPackageHandleStandardArgs)
set_property(CACHE CEF_ROOT_DIR PROPERTY HELPSTRING
"Path to CEF distributed build")
if(NOT DEFINED CEF_ROOT_DIR OR CEF_ROOT_DIR STREQUAL "")
message(
FATAL_ERROR
"CEF_ROOT_DIR is not set - if ENABLE_BROWSER is enabled, a CEF distribution with compiled wrapper library is required.\n"
"Please download a CEF distribution for your appropriate architecture and specify CEF_ROOT_DIR to its location"
)
endif()
find_path(CEF_INCLUDE_DIR "include/cef_version.h" HINTS "${CEF_ROOT_DIR}")
if(OS_MACOS)
find_library(
CEF_LIBRARY
NAMES cef libcef cef.lib libcef.o "Chromium Embedded Framework"
NO_DEFAULT_PATH
PATHS "${CEF_ROOT_DIR}" "${CEF_ROOT_DIR}/Release")
find_library(
CEFWRAPPER_LIBRARY
NAMES cef_dll_wrapper libcef_dll_wrapper
NO_DEFAULT_PATH
PATHS "${CEF_ROOT_DIR}/build/libcef_dll/Release"
"${CEF_ROOT_DIR}/build/libcef_dll_wrapper/Release"
"${CEF_ROOT_DIR}/build/libcef_dll"
"${CEF_ROOT_DIR}/build/libcef_dll_wrapper")
elseif(OS_POSIX)
find_library(
CEF_LIBRARY
NAMES libcef.so "Chromium Embedded Framework"
NO_DEFAULT_PATH
PATHS "${CEF_ROOT_DIR}" "${CEF_ROOT_DIR}/Release")
find_library(
CEFWRAPPER_LIBRARY
NAMES libcef_dll_wrapper.a
NO_DEFAULT_PATH
PATHS "${CEF_ROOT_DIR}/build/libcef_dll_wrapper"
"${CEF_ROOT_DIR}/libcef_dll_wrapper")
else()
find_library(
CEF_LIBRARY
NAMES cef libcef cef.lib libcef.o "Chromium Embedded Framework"
PATHS "${CEF_ROOT_DIR}" "${CEF_ROOT_DIR}/Release")
find_library(
CEFWRAPPER_LIBRARY
NAMES cef_dll_wrapper libcef_dll_wrapper
PATHS "${CEF_ROOT_DIR}/build/libcef_dll/Release"
"${CEF_ROOT_DIR}/build/libcef_dll_wrapper/Release"
"${CEF_ROOT_DIR}/build/libcef_dll"
"${CEF_ROOT_DIR}/build/libcef_dll_wrapper")
if(OS_WINDOWS)
find_library(
CEFWRAPPER_LIBRARY_DEBUG
NAMES cef_dll_wrapper libcef_dll_wrapper
PATHS "${CEF_ROOT_DIR}/build/libcef_dll/Debug"
"${CEF_ROOT_DIR}/build/libcef_dll_wrapper/Debug")
endif()
endif()
mark_as_advanced(CEFWRAPPER_LIBRARY CEFWRAPPER_LIBRARY_DEBUG)
if(NOT CEF_LIBRARY)
message(
WARNING
" Could NOT find Chromium Embedded Framework library (missing: CEF_LIBRARY)"
)
set(CEF_FOUND FALSE)
return()
endif()
if(NOT CEFWRAPPER_LIBRARY)
message(
WARNING
" Could NOT find Chromium Embedded Framework wrapper library (missing: CEFWRAPPER_LIBRARY)"
)
set(CEF_FOUND FALSE)
return()
endif()
message(
STATUS
"Found Chromium Embedded Framework: ${CEF_LIBRARY};${CEF_WRAPPER_LIBRARY}")
if(OS_WINDOWS)
set(CEF_LIBRARIES ${CEF_LIBRARY} ${CEFWRAPPER_LIBRARY})
elseif(OS_MACOS)
if(BROWSER_LEGACY)
set(CEF_LIBRARIES ${CEFWRAPPER_LIBRARY} ${CEF_LIBRARY})
else()
set(CEF_LIBRARIES ${CEFWRAPPER_LIBRARY})
endif()
else()
set(CEF_LIBRARIES ${CEF_LIBRARY} optimized ${CEFWRAPPER_LIBRARY})
if(CEFWRAPPER_LIBRARY_DEBUG)
list(APPEND CEF_LIBRARIES debug ${CEFWRAPPER_LIBRARY_DEBUG})
endif()
endif()
find_package_handle_standard_args(CEF DEFAULT_MSG CEF_LIBRARY
CEFWRAPPER_LIBRARY CEF_INCLUDE_DIR)
mark_as_advanced(CEF_LIBRARY CEF_WRAPPER_LIBRARY CEF_LIBRARIES CEF_INCLUDE_DIR)
if(NOT TARGET CEF::Wrapper)
if(IS_ABSOLUTE "${CEF_LIBRARIES}")
add_library(CEF::Wrapper UNKNOWN IMPORTED)
add_library(CEF::Library UNKNOWN IMPORTED)
set_target_properties(CEF::Wrapper PROPERTIES IMPORTED_LOCATION
${CEFWRAPPER_LIBRARY})
set_target_properties(CEF::Library PROPERTIES IMPORTED_LOCATION
${CEF_LIBRARY})
if(DEFINED CEFWRAPPER_LIBRARY_DEBUG)
add_library(CEF::Wrapper_Debug UNKNOWN IMPORTED)
set_target_properties(
CEF::Wrapper_Debug PROPERTIES IMPORTED_LOCATION
${CEFWRAPPER_LIBRARY_DEBUG})
endif()
else()
add_library(CEF::Wrapper INTERFACE IMPORTED)
add_library(CEF::Library INTERFACE IMPORTED)
set_target_properties(CEF::Wrapper PROPERTIES IMPORTED_LIBNAME
${CEFWRAPPER_LIBRARY})
set_target_properties(CEF::Library PROPERTIES IMPORTED_LIBNAME
${CEF_LIBRARY})
if(DEFINED CEFWRAPPER_LIBRARY_DEBUG)
add_library(CEF::Wrapper_Debug INTERFACE IMPORTED)
set_target_properties(
CEF::Wrapper_Debug PROPERTIES IMPORTED_LIBNAME
${CEFWRAPPER_LIBRARY_DEBUG})
endif()
endif()
set_target_properties(CEF::Wrapper PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${CEF_INCLUDE_DIR}")
set_target_properties(CEF::Library PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${CEF_INCLUDE_DIR}")
if(DEFINED CEFWRAPPER_LIBRARY_DEBUG)
set_target_properties(
CEF::Wrapper_Debug PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${CEF_INCLUDE_DIR}")
endif()
endif()

View File

@ -1,68 +0,0 @@
# - Finds if the compiler has C++11 support
# This module can be used to detect compiler flags for using C++11, and checks
# a small subset of the language.
#
# The following variables are set:
# CXX11_FLAGS - flags to add to the CXX compiler for C++11 support
# CXX11_FOUND - true if the compiler supports C++11
#
if(CXX11_FLAGS)
set(CXX11_FOUND TRUE)
return()
endif()
include(CheckCXXSourceCompiles)
if(MSVC)
set(CXX11_FLAG_CANDIDATES
" "
)
else()
set(CXX11_FLAG_CANDIDATES
#gcc
"-std=gnu++11"
"-std=gnu++0x"
#Gnu and Intel Linux
"-std=c++11"
"-std=c++0x"
#Microsoft Visual Studio, and everything that automatically accepts C++11
" "
#Intel windows
"/Qstd=c++11"
"/Qstd=c++0x"
)
endif()
set(CXX11_TEST_SOURCE
"
int main()
{
int n[] = {4,7,6,1,2};
int r;
auto f = [&](int j) { r = j; };
for (auto i : n)
f(i);
return 0;
}
")
foreach(FLAG ${CXX11_FLAG_CANDIDATES})
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(CXX11_FLAG_DETECTED CACHE)
message(STATUS "Try C++11 flag = [${FLAG}]")
check_cxx_source_compiles("${CXX11_TEST_SOURCE}" CXX11_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(CXX11_FLAG_DETECTED)
set(CXX11_FLAGS_INTERNAL "${FLAG}")
break()
endif(CXX11_FLAG_DETECTED)
endforeach(FLAG ${CXX11_FLAG_CANDIDATES})
set(CXX11_FLAGS "${CXX11_FLAGS_INTERNAL}" CACHE STRING "C++11 Flags")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CXX11 DEFAULT_MSG CXX11_FLAGS)
mark_as_advanced(CXX11_FLAGS)

View File

@ -1,68 +1,75 @@
# Once done these will be defined:
#
# DETOURS_FOUND
# DETOURS_INCLUDE_DIRS
# DETOURS_LIBRARIES
# * DETOURS_FOUND
# * DETOURS_INCLUDE_DIRS
# * DETOURS_LIBRARIES
#
# For use in OBS:
#
# DETOURS_INCLUDE_DIR
# DETOURS_INCLUDE_DIR
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_DETOURS QUIET detours)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_DETOURS QUIET detours)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
set(_lib_suffix 32)
endif()
find_path(DETOURS_INCLUDE_DIR
NAMES detours.h
HINTS
ENV detoursPath${_lib_suffix}
ENV detoursPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${detoursPath${_lib_suffix}}
${detoursPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_DETOURS_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES
include)
find_path(
DETOURS_INCLUDE_DIR
NAMES detours.h
HINTS ENV DETOURS_PATH ${DETOURS_PATH} ${CMAKE_SOURCE_DIR}/${DETOURS_PATH}
${_DETOURS_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES include)
find_library(DETOURS_LIB
NAMES ${_DETOURS_LIBRARIES} detours
HINTS
ENV detoursPath${_lib_suffix}
ENV detoursPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${detoursPath${_lib_suffix}}
${detoursPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_DETOURS_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
DETOURS_LIB
NAMES ${_DETOURS_LIBRARIES} detours
HINTS ENV DETOURS_PATH ${DETOURS_PATH} ${CMAKE_SOURCE_DIR}/${DETOURS_PATH}
${_DETOURS_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Detours DEFAULT_MSG DETOURS_LIB DETOURS_INCLUDE_DIR)
find_package_handle_standard_args(Detours DEFAULT_MSG DETOURS_LIB
DETOURS_INCLUDE_DIR)
mark_as_advanced(DETOURS_INCLUDE_DIR DETOURS_LIB)
if(DETOURS_FOUND)
set(DETOURS_INCLUDE_DIRS ${DETOURS_INCLUDE_DIR})
set(DETOURS_LIBRARIES ${DETOURS_LIB})
set(DETOURS_INCLUDE_DIRS ${DETOURS_INCLUDE_DIR})
set(DETOURS_LIBRARIES ${DETOURS_LIB})
if(NOT TARGET Detours::Detours)
if(IS_ABSOLUTE "${DETOURS_LIBRARIES}")
add_library(Detours::Detours UNKNOWN IMPORTED)
set_target_properties(Detours::Detours PROPERTIES IMPORTED_LOCATION
"${DETOURS_LIBRARIES}")
else()
add_library(Detours::Detours INTERFACE IMPORTED)
set_target_properties(Detours::Detours PROPERTIES IMPORTED_LIBNAME
"${DETOURS_LIBRARIES}")
endif()
set_target_properties(
Detours::Detours PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${DETOURS_INCLUDE_DIRS}")
endif()
endif()

View File

@ -1,53 +0,0 @@
# - Try to Find EGL
# Once done, this will define
#
# EGL_FOUND - system has EGL installed.
# EGL_INCLUDE_DIRS - directories which contain the EGL headers.
# EGL_LIBRARIES - libraries required to link against EGL.
# EGL_DEFINITIONS - Compiler switches required for using EGL.
#
# Copyright (C) 2012 Intel Corporation. All rights reserved.
# 2020 Georges Basile Stavracas Neto
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
find_package(PkgConfig)
pkg_check_modules(PC_EGL egl)
if (PC_EGL_FOUND)
set(EGL_DEFINITIONS ${PC_EGL_CFLAGS_OTHER})
endif ()
find_path(EGL_INCLUDE_DIRS NAMES EGL/egl.h
HINTS ${PC_EGL_INCLUDE_DIR} ${PC_EGL_INCLUDE_DIRS}
)
find_library(EGL_LIBRARIES NAMES egl EGL
HINTS ${PC_EGL_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EGL DEFAULT_MSG EGL_INCLUDE_DIRS EGL_LIBRARIES)
mark_as_advanced(EGL_INCLUDE_DIRS EGL_LIBRARIES)

View File

@ -1,155 +1,200 @@
#
# This module defines the following variables:
#
# FFMPEG_FOUND - All required components and the core library were found
# FFMPEG_INCLUDE_DIRS - Combined list of all components include dirs
# FFMPEG_LIBRARIES - Combined list of all components libraries
# FFMPEG_VERSION_STRING - Version of the first component requested
# FFMPEG_FOUND - All required components and the core library were found
# FFMPEG_INCLUDE_DIRS - Combined list of all components include dirs
# FFMPEG_LIBRARIES - Combined list of all components libraries
# FFMPEG_VERSION_STRING - Version of the first component requested
#
# For each requested component the following variables are defined:
#
# FFMPEG_<component>_FOUND - The component was found
# FFMPEG_<component>_INCLUDE_DIRS - The components include dirs
# FFMPEG_<component>_LIBRARIES - The components libraries
# FFMPEG_<component>_VERSION_STRING - The components version string
# FFMPEG_<component>_VERSION_MAJOR - The components major version
# FFMPEG_<component>_VERSION_MINOR - The components minor version
# FFMPEG_<component>_VERSION_MICRO - The components micro version
# FFMPEG_<component>_FOUND - The component was found
# FFMPEG_<component>_INCLUDE_DIRS - The components include dirs
# FFMPEG_<component>_LIBRARIES - The components libraries
# FFMPEG_<component>_VERSION_STRING - The components version string
# FFMPEG_<component>_VERSION_MAJOR - The components major version
# FFMPEG_<component>_VERSION_MINOR - The components minor version
# FFMPEG_<component>_VERSION_MICRO - The components micro version
#
# <component> is the uppercase name of the component
find_package(PkgConfig QUIET)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
set(_lib_suffix 32)
endif()
function(find_ffmpeg_library component header)
string(TOUPPER "${component}" component_u)
set(FFMPEG_${component_u}_FOUND FALSE PARENT_SCOPE)
set(FFmpeg_${component}_FOUND FALSE PARENT_SCOPE)
string(TOUPPER "${component}" component_u)
set(FFMPEG_${component_u}_FOUND
FALSE
PARENT_SCOPE)
set(FFmpeg_${component}_FOUND
FALSE
PARENT_SCOPE)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_FFMPEG_${component} QUIET lib${component})
endif()
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_FFMPEG_${component} QUIET lib${component})
endif()
find_path(FFMPEG_${component}_INCLUDE_DIR
NAMES
"lib${component}/${header}" "lib${component}/version.h"
HINTS
ENV FFmpegPath${_lib_suffix}
ENV FFmpegPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${FFmpegPath${_lib_suffix}}
${FFmpegPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${PC_FFMPEG_${component}_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES ffmpeg libav include)
find_path(
FFMPEG_${component}_INCLUDE_DIR
NAMES "lib${component}/${header}" "lib${component}/version.h"
HINTS ENV FFMPEG_PATH ${FFMPEG_PATH} ${CMAKE_SOURCE_DIR}/${FFMPEG_PATH}
${PC_FFMPEG_${component}_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES ffmpeg libav include)
find_library(FFMPEG_${component}_LIBRARY
NAMES
"${component}" "lib${component}"
HINTS
ENV FFmpegPath${_lib_suffix}
ENV FFmpegPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${FFmpegPath${_lib_suffix}}
${FFmpegPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${PC_FFMPEG_${component}_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
FFMPEG_${component}_LIBRARY
NAMES "${component}" "lib${component}"
HINTS ENV FFMPEG_PATH ${FFMPEG_PATH} ${CMAKE_SOURCE_DIR}/${FFMPEG_PATH}
${PC_FFMPEG_${component}_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
set(FFMPEG_${component_u}_INCLUDE_DIRS ${FFMPEG_${component}_INCLUDE_DIR} PARENT_SCOPE)
set(FFMPEG_${component_u}_LIBRARIES ${FFMPEG_${component}_LIBRARY} PARENT_SCOPE)
set(FFMPEG_${component_u}_INCLUDE_DIRS
${FFMPEG_${component}_INCLUDE_DIR}
PARENT_SCOPE)
set(FFMPEG_${component_u}_LIBRARIES
${FFMPEG_${component}_LIBRARY}
PARENT_SCOPE)
mark_as_advanced(FFMPEG_${component}_INCLUDE_DIR FFMPEG_${component}_LIBRARY)
mark_as_advanced(FFMPEG_${component}_INCLUDE_DIR FFMPEG_${component}_LIBRARY)
if(FFMPEG_${component}_INCLUDE_DIR AND FFMPEG_${component}_LIBRARY)
set(FFMPEG_${component_u}_FOUND TRUE PARENT_SCOPE)
set(FFmpeg_${component}_FOUND TRUE PARENT_SCOPE)
if(FFMPEG_${component}_INCLUDE_DIR AND FFMPEG_${component}_LIBRARY)
set(FFMPEG_${component_u}_FOUND
TRUE
PARENT_SCOPE)
set(FFmpeg_${component}_FOUND
TRUE
PARENT_SCOPE)
list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_${component}_INCLUDE_DIR})
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
set(FFMPEG_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIRS}" PARENT_SCOPE)
list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_${component}_INCLUDE_DIR})
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
set(FFMPEG_INCLUDE_DIRS
"${FFMPEG_INCLUDE_DIRS}"
PARENT_SCOPE)
list(APPEND FFMPEG_LIBRARIES ${FFMPEG_${component}_LIBRARY})
list(REMOVE_DUPLICATES FFMPEG_LIBRARIES)
set(FFMPEG_LIBRARIES "${FFMPEG_LIBRARIES}" PARENT_SCOPE)
list(APPEND FFMPEG_LIBRARIES ${FFMPEG_${component}_LIBRARY})
list(REMOVE_DUPLICATES FFMPEG_LIBRARIES)
set(FFMPEG_LIBRARIES
"${FFMPEG_LIBRARIES}"
PARENT_SCOPE)
set(FFMPEG_${component_u}_VERSION_STRING "unknown" PARENT_SCOPE)
set(_vfile "${FFMPEG_${component}_INCLUDE_DIR}/lib${component}/version.h")
set(FFMPEG_${component_u}_VERSION_STRING
"unknown"
PARENT_SCOPE)
set(_vfile "${FFMPEG_${component}_INCLUDE_DIR}/lib${component}/version.h")
if(EXISTS "${_vfile}")
file(STRINGS "${_vfile}" _version_parse REGEX "^.*VERSION_(MAJOR|MINOR|MICRO)[ \t]+[0-9]+[ \t]*$")
string(REGEX REPLACE ".*VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" _major "${_version_parse}")
string(REGEX REPLACE ".*VERSION_MINOR[ \t]+([0-9]+).*" "\\1" _minor "${_version_parse}")
string(REGEX REPLACE ".*VERSION_MICRO[ \t]+([0-9]+).*" "\\1" _micro "${_version_parse}")
if(EXISTS "${_vfile}")
file(STRINGS "${_vfile}" _version_parse
REGEX "^.*VERSION_(MAJOR|MINOR|MICRO)[ \t]+[0-9]+[ \t]*$")
string(REGEX REPLACE ".*VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" _major
"${_version_parse}")
string(REGEX REPLACE ".*VERSION_MINOR[ \t]+([0-9]+).*" "\\1" _minor
"${_version_parse}")
string(REGEX REPLACE ".*VERSION_MICRO[ \t]+([0-9]+).*" "\\1" _micro
"${_version_parse}")
set(FFMPEG_${component_u}_VERSION_MAJOR "${_major}" PARENT_SCOPE)
set(FFMPEG_${component_u}_VERSION_MINOR "${_minor}" PARENT_SCOPE)
set(FFMPEG_${component_u}_VERSION_MICRO "${_micro}" PARENT_SCOPE)
set(FFMPEG_${component_u}_VERSION_MAJOR
"${_major}"
PARENT_SCOPE)
set(FFMPEG_${component_u}_VERSION_MINOR
"${_minor}"
PARENT_SCOPE)
set(FFMPEG_${component_u}_VERSION_MICRO
"${_micro}"
PARENT_SCOPE)
set(FFMPEG_${component_u}_VERSION_STRING "${_major}.${_minor}.${_micro}" PARENT_SCOPE)
else()
message(STATUS "Failed parsing FFmpeg ${component} version")
endif()
endif()
set(FFMPEG_${component_u}_VERSION_STRING
"${_major}.${_minor}.${_micro}"
PARENT_SCOPE)
else()
message(STATUS "Failed parsing FFmpeg ${component} version")
endif()
endif()
endfunction()
set(FFMPEG_INCLUDE_DIRS)
set(FFMPEG_LIBRARIES)
if(NOT FFmpeg_FIND_COMPONENTS)
message(FATAL_ERROR "No FFmpeg components requested")
message(FATAL_ERROR "No FFmpeg components requested")
endif()
list(GET FFmpeg_FIND_COMPONENTS 0 _first_comp)
string(TOUPPER "${_first_comp}" _first_comp)
foreach(component ${FFmpeg_FIND_COMPONENTS})
if(component STREQUAL "avcodec")
find_ffmpeg_library("${component}" "avcodec.h")
elseif(component STREQUAL "avdevice")
find_ffmpeg_library("${component}" "avdevice.h")
elseif(component STREQUAL "avfilter")
find_ffmpeg_library("${component}" "avfilter.h")
elseif(component STREQUAL "avformat")
find_ffmpeg_library("${component}" "avformat.h")
elseif(component STREQUAL "avresample")
find_ffmpeg_library("${component}" "avresample.h")
elseif(component STREQUAL "avutil")
find_ffmpeg_library("${component}" "avutil.h")
elseif(component STREQUAL "postproc")
find_ffmpeg_library("${component}" "postprocess.h")
elseif(component STREQUAL "swresample")
find_ffmpeg_library("${component}" "swresample.h")
elseif(component STREQUAL "swscale")
find_ffmpeg_library("${component}" "swscale.h")
else()
message(FATAL_ERROR "Unknown FFmpeg component requested: ${component}")
endif()
if(component STREQUAL "avcodec")
find_ffmpeg_library("${component}" "avcodec.h")
elseif(component STREQUAL "avdevice")
find_ffmpeg_library("${component}" "avdevice.h")
elseif(component STREQUAL "avfilter")
find_ffmpeg_library("${component}" "avfilter.h")
elseif(component STREQUAL "avformat")
find_ffmpeg_library("${component}" "avformat.h")
elseif(component STREQUAL "avresample")
find_ffmpeg_library("${component}" "avresample.h")
elseif(component STREQUAL "avutil")
find_ffmpeg_library("${component}" "avutil.h")
elseif(component STREQUAL "postproc")
find_ffmpeg_library("${component}" "postprocess.h")
elseif(component STREQUAL "swresample")
find_ffmpeg_library("${component}" "swresample.h")
elseif(component STREQUAL "swscale")
find_ffmpeg_library("${component}" "swscale.h")
else()
message(FATAL_ERROR "Unknown FFmpeg component requested: ${component}")
endif()
endforeach()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFmpeg
FOUND_VAR FFMPEG_FOUND
REQUIRED_VARS FFMPEG_${_first_comp}_LIBRARIES FFMPEG_${_first_comp}_INCLUDE_DIRS
VERSION_VAR FFMPEG_${_first_comp}_VERSION_STRING
HANDLE_COMPONENTS)
find_package_handle_standard_args(
FFmpeg
FOUND_VAR FFMPEG_FOUND
REQUIRED_VARS FFMPEG_${_first_comp}_LIBRARIES
FFMPEG_${_first_comp}_INCLUDE_DIRS
VERSION_VAR FFMPEG_${_first_comp}_VERSION_STRING
HANDLE_COMPONENTS)
if(FFMPEG_FOUND)
foreach(component ${FFmpeg_FIND_COMPONENTS})
if(NOT TARGET FFmpeg::${component})
string(TOUPPER ${component} component_u)
if(FFMPEG_${component_u}_FOUND)
if(IS_ABSOLUTE "${FFMPEG_${component_u}_LIBRARIES}")
add_library(FFmpeg::${component} UNKNOWN IMPORTED)
set_target_properties(
FFmpeg::${component}
PROPERTIES IMPORTED_LOCATION "${FFMPEG_${component_u}_LIBRARIES}")
else()
add_library(FFmpeg::${component} INTERFACE IMPORTED)
set_target_properties(
FFmpeg::${component}
PROPERTIES IMPORTED_LIBNAME "${FFMPEG_${component_u}_LIBRARIES}")
endif()
set_target_properties(
FFmpeg::${component}
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${FFMPEG_${component_u}_INCLUDE_DIRS}")
endif()
endif()
endforeach()
endif()

View File

@ -1,34 +0,0 @@
# Once done these will be defined:
#
# FONTCONFIG_FOUND
# FONTCONFIG_INCLUDE_DIRS
# FONTCONFIG_LIBRARIES
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_FONTCONFIG QUIET fontconfig)
endif()
find_path(FONTCONFIG_INCLUDE_DIR
NAMES fontconfig/fontconfig.h
HINTS
${_FONTCONFIG_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include)
find_library(FONTCONFIG_LIB
NAMES fontconfig
HINTS
${_FONTCONFIG_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Fontconfig DEFAULT_MSG FONTCONFIG_LIB
FONTCONFIG_INCLUDE_DIR)
mark_as_advanced(FONTCONFIG_INCLUDE_DIR FONTCONFIG_LIB)
if(FONTCONFIG_FOUND)
set(FONTCONFIG_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR})
set(FONTCONFIG_LIBRARIES "${FONTCONFIG_LIB}")
endif()

View File

@ -1,94 +0,0 @@
# Once done these will be defined:
#
# FREETYPE_FOUND
# FREETYPE_INCLUDE_DIRS
# FREETYPE_LIBRARIES
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_FREETYPE QUIET freetype2)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
endif()
find_path(FREETYPE_INCLUDE_DIR_ft2build
NAMES
ft2build.h
HINTS
ENV FreetypePath${_lib_suffix}
ENV FreetypePath
ENV FREETYPE_DIR
ENV DepsPath${_lib_suffix}
ENV DepsPath
${FreetypePath${_lib_suffix}}
${FreetypePath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_FREETYPE_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES
freetype2 include/freetype2 include)
find_path(FREETYPE_INCLUDE_DIR_freetype2
NAMES
freetype/config/ftheader.h
config/ftheader.h
HINTS
ENV FreetypePath${_lib_suffix}
ENV FreetypePath
ENV FREETYPE_DIR
ENV DepsPath${_lib_suffix}
ENV DepsPath
${FreetypePath${_lib_suffix}}
${FreetypePath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_FREETYPE_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES
freetype2 include/freetype2 include)
find_library(FREETYPE_LIB
NAMES ${_FREETYPE_LIBRARIES} freetype libfreetype
HINTS
ENV FreetypePath${_lib_suffix}
ENV FreetypePath
ENV FREETYPE_DIR
ENV DepsPath${_lib_suffix}
ENV DepsPath
${FreetypePath${_lib_suffix}}
${FreetypePath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_FREETYPE_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
set(FREETYPE_INCLUDE_DIR "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIR)
else()
unset(FREETYPE_INCLUDE_DIR)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Freetype DEFAULT_MSG FREETYPE_LIB FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2)
mark_as_advanced(FREETYPE_INCLUDE_DIR FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_LIB)
if(FREETYPE_FOUND)
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
set(FREETYPE_LIBRARIES ${FREETYPE_LIB})
endif()

View File

@ -1,27 +1,53 @@
# - Try to find Gio
# Once done this will define
# * Try to find Gio Once done this will define
#
# GIO_FOUND - system has Gio
# GIO_INCLUDE_DIRS - the Gio include directory
# GIO_LIBRARIES - the libraries needed to use Gio
# GIO_DEFINITIONS - Compiler switches required for using Gio
# GIO_FOUND - system has Gio GIO_INCLUDE_DIRS - the Gio include directory
# GIO_LIBRARIES - the libraries needed to use Gio GIO_DEFINITIONS - Compiler
# switches required for using Gio
# Use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
find_package(PkgConfig)
pkg_check_modules(PC_GIO gio-2.0 gio-unix-2.0)
# Use pkg-config to get the directories and then use these values in the
# find_path() and find_library() calls
set(GIO_DEFINITIONS ${PC_GIO_CFLAGS})
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_GIO gio-2.0 gio-unix-2.0)
endif()
find_path(GIO_INCLUDE_DIRS gio.h PATHS ${PC_GIO_INCLUDEDIR} ${PC_GIO_INCLUDE_DIRS} PATH_SUFFIXES glib-2.0/gio/)
find_library(GIO_LIBRARIES NAMES gio-2.0 libgio-2.0 gio-unix-2.0 PATHS ${PC_GIO_LIBDIR} ${PC_GIO_LIBRARY_DIRS})
mark_as_advanced(GIO_INCLUDE_DIRS GIO_LIBRARIES)
find_path(
GIO_INCLUDE_DIR
NAMES gio.h
HINTS ${_GIO_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES glib-2.0/gio/)
find_library(
GIO_LIB
NAMES ${_GIO_LIBRARIES} gio-2.0 libgio-2.0 gio-unix-2.0
HINTS ${_GIO_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Gio REQUIRED_VARS GIO_LIBRARIES GIO_INCLUDE_DIRS)
find_package_handle_standard_args(Gio REQUIRED_VARS GIO_LIB GIO_INCLUDE_DIR)
mark_as_advanced(GIO_INCLUDE_DIR GIO_LIB)
if(GIO_FOUND)
set(HAVE_DBUS "1")
else()
set(HAVE_DBUS "0")
set(GIO_INCLUDE_DIRS ${GIO_INCLUDE_DIR})
set(GIO_LIBRARIES ${GIO_LIB})
if(NOT TARGET GIO::GIO)
if(IS_ABSOLUTE "${GIO_LIBRARIES}")
add_library(GIO::GIO UNKNOWN IMPORTED)
set_target_properties(GIO::GIO PROPERTIES IMPORTED_LOCATION
"${GIO_LIBRARIES}")
else()
add_library(GIO::GIO INTERFACE IMPORTED)
set_target_properties(GIO::GIO PROPERTIES IMPORTED_LIBNAME
"${GIO_LIBRARIES}")
endif()
# Special case for gio, as both the
set_target_properties(GIO::GIO PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${_GIO_INCLUDE_DIRS}")
target_compile_options(GIO::GIO INTERFACE ${_GIO_CFLAGS})
endif()
endif()

View File

@ -1,45 +0,0 @@
# Once done these will be defined:
#
# ICONV_FOUND
# ICONV_INCLUDE_DIRS
# ICONV_LIBRARIES
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_ICONV QUIET iconv)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
endif()
find_path(ICONV_INCLUDE_DIR
NAMES iconv.h
HINTS
ENV IconvPath${_lib_suffix}
ENV IconvPath
${_ICONV_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include)
find_library(ICONV_LIB
NAMES ${_ICONV_LIBRARIES} iconv libiconv
HINTS
${_ICONV_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Iconv DEFAULT_MSG ICONV_LIB ICONV_INCLUDE_DIR)
mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIB)
if(ICONV_FOUND)
set(ICONV_INCLUDE_DIRS ${ICONV_INCLUDE_DIR})
set(ICONV_LIBRARIES ${ICONV_LIB})
endif()

View File

@ -1,82 +1,78 @@
# - Try to find jack-2.6
# Once done this will define
# * Try to find jack-2.6 Once done this will define
#
# JACK_FOUND - system has jack
# JACK_INCLUDE_DIRS - the jack include directory
# JACK_LIBRARIES - Link these to use jack
# JACK_DEFINITIONS - Compiler switches required for using jack
# JACK_FOUND - system has jack JACK_INCLUDE_DIRS - the jack include directory
# JACK_LIBRARIES - Link these to use jack JACK_DEFINITIONS - Compiler switches
# required for using jack
#
# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
# Modified for other libraries by Lasse Kärkkäinen <tronic>
# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org> Modified for other
# libraries by Lasse Kärkkäinen <tronic>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Redistribution and use is allowed according to the terms of the New BSD
# license. For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
if(JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
# in cache already
set(JACK_FOUND TRUE)
else (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
else(JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
# use pkg-config to get the directories and then use these values in the
# FIND_PATH() and FIND_LIBRARY() calls
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
include(UsePkgConfig)
pkgconfig(jack _JACK_INCLUDEDIR _JACK_LIBDIR _JACK_LDFLAGS _JACK_CFLAGS)
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
else(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_JACK jack)
endif (PKG_CONFIG_FOUND)
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_path(JACK_INCLUDE_DIR
NAMES
jack/jack.h
PATHS
${_JACK_INCLUDE_DIRS}
/usr/include
/usr/local/include
/opt/local/include
/sw/include
)
endif(PKG_CONFIG_FOUND)
endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_path(
JACK_INCLUDE_DIR
NAMES jack/jack.h
PATHS ${_JACK_INCLUDE_DIRS} /usr/include /usr/local/include
/opt/local/include /sw/include)
find_library(JACK_LIBRARY
NAMES
jack
PATHS
${_JACK_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
find_library(
JACK_LIBRARY
NAMES jack
PATHS ${_JACK_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib)
if (JACK_LIBRARY AND JACK_INCLUDE_DIR)
if(JACK_LIBRARY AND JACK_INCLUDE_DIR)
set(JACK_FOUND TRUE)
set(JACK_INCLUDE_DIRS
${JACK_INCLUDE_DIR}
)
set(JACK_INCLUDE_DIRS ${JACK_INCLUDE_DIR})
set(JACK_LIBRARIES
${JACK_LIBRARIES}
${JACK_LIBRARY}
)
set(JACK_LIBRARIES ${JACK_LIBRARIES} ${JACK_LIBRARY})
endif (JACK_LIBRARY AND JACK_INCLUDE_DIR)
endif(JACK_LIBRARY AND JACK_INCLUDE_DIR)
if (JACK_FOUND)
if (NOT JACK_FIND_QUIETLY)
if(JACK_FOUND)
if(NOT JACK_FIND_QUIETLY)
message(STATUS "Found jack: ${JACK_LIBRARY}")
endif (NOT JACK_FIND_QUIETLY)
else (JACK_FOUND)
if (JACK_FIND_REQUIRED)
message(FATAL_ERROR "Could not find JACK")
endif (JACK_FIND_REQUIRED)
endif (JACK_FOUND)
endif(NOT JACK_FIND_QUIETLY)
# show the JACK_INCLUDE_DIRS and JACK_LIBRARIES variables only in the advanced view
if(NOT TARGET Jack::Jack)
if(IS_ABSOLUTE "${JACK_LIBRARIES}")
add_library(Jack::Jack UNKNOWN IMPORTED)
set_target_properties(Jack::Jack PROPERTIES IMPORTED_LOCATION
"${JACK_LIBRARIES}")
else()
add_library(Jack::Jack INTERFACE IMPORTED)
set_target_properties(Jack::Jack PROPERTIES IMPORTED_LIBNAME
"${JACK_LIBRARIES}")
endif()
set_target_properties(Jack::Jack PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${JACK_INCLUDE_DIRS}")
endif()
else(JACK_FOUND)
if(JACK_FIND_REQUIRED)
message(FATAL_ERROR "Could not find JACK")
endif(JACK_FIND_REQUIRED)
endif(JACK_FOUND)
# show the JACK_INCLUDE_DIRS and JACK_LIBRARIES variables only in the advanced
# view
mark_as_advanced(JACK_INCLUDE_DIRS JACK_LIBRARIES)
endif (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
endif(JACK_LIBRARIES AND JACK_INCLUDE_DIRS)

View File

@ -1,84 +1,87 @@
# Once done these will be defined:
#
# JANSSON_FOUND
# JANSSON_INCLUDE_DIRS
# JANSSON_LIBRARIES
# JANSSON_VERSION
# JANSSON_FOUND JANSSON_INCLUDE_DIRS JANSSON_LIBRARIES JANSSON_VERSION
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_JANSSON QUIET jansson)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_JANSSON QUIET jansson)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
set(_lib_suffix 32)
endif()
find_path(Jansson_INCLUDE_DIR
NAMES jansson.h
HINTS
ENV JanssonPath${_lib_suffix}
ENV JanssonPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${JanssonPath${_lib_suffix}}
${JanssonPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_JANSSON_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include)
find_path(
Jansson_INCLUDE_DIR
NAMES jansson.h
HINTS ENV JANSSON_PATH ${JANSSON_PATH} ${CMAKE_SOURCE_DIR}/${JANSSON_PATH}
${_JANSSON_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include /sw/include)
find_library(Jansson_LIB
NAMES ${_JANSSON_LIBRARIES} jansson libjansson
HINTS
ENV JanssonPath${_lib_suffix}
ENV JanssonPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${JanssonPath${_lib_suffix}}
${JanssonPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_JANSSON_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
Jansson_LIB
NAMES ${_JANSSON_LIBRARIES} jansson libjansson
HINTS ENV JANSSON_PATH ${JANSSON_PATH} ${CMAKE_SOURCE_DIR}/${JANSSON_PATH}
${_JANSSON_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
if(JANSSON_VERSION)
set(_JANSSON_VERSION_STRING "${JANSSON_VERSION}")
set(_JANSSON_VERSION_STRING "${JANSSON_VERSION}")
elseif(_JANSSON_FOUND AND _JANSSON_VERSION)
set(_JANSSON_VERSION_STRING "${_JANSSON_VERSION}")
set(_JANSSON_VERSION_STRING "${_JANSSON_VERSION}")
elseif(EXISTS "${Jansson_INCLUDE_DIR}/jansson.h")
file(STRINGS "${Jansson_INCLUDE_DIR}/jansson.h" _jansson_version_parse
REGEX "#define[ \t]+JANSSON_VERSION[ \t]+.+")
string(REGEX REPLACE
".*#define[ \t]+JANSSON_VERSION[ \t]+\"(.+)\".*" "\\1"
_JANSSON_VERSION_STRING "${_jansson_version_parse}")
file(STRINGS "${Jansson_INCLUDE_DIR}/jansson.h" _jansson_version_parse
REGEX "#define[ \t]+JANSSON_VERSION[ \t]+.+")
string(REGEX REPLACE ".*#define[ \t]+JANSSON_VERSION[ \t]+\"(.+)\".*" "\\1"
_JANSSON_VERSION_STRING "${_jansson_version_parse}")
else()
if(NOT Jansson_FIND_QUIETLY)
message(WARNING "Failed to find Jansson version")
endif()
set(_JANSSON_VERSION_STRING "unknown")
if(NOT Jansson_FIND_QUIETLY)
message(WARNING "Failed to find Jansson version")
endif()
set(_JANSSON_VERSION_STRING "unknown")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Jansson
FOUND_VAR JANSSON_FOUND
REQUIRED_VARS Jansson_LIB Jansson_INCLUDE_DIR
VERSION_VAR _JANSSON_VERSION_STRING)
find_package_handle_standard_args(
Jansson
FOUND_VAR JANSSON_FOUND
REQUIRED_VARS Jansson_LIB Jansson_INCLUDE_DIR
VERSION_VAR _JANSSON_VERSION_STRING)
mark_as_advanced(Jansson_INCLUDE_DIR Jansson_LIB)
if(JANSSON_FOUND)
set(JANSSON_INCLUDE_DIRS ${Jansson_INCLUDE_DIR})
set(JANSSON_LIBRARIES ${Jansson_LIB})
set(JANSSON_VERSION ${_JANSSON_VERSION_STRING})
set(JANSSON_INCLUDE_DIRS ${Jansson_INCLUDE_DIR})
set(JANSSON_LIBRARIES ${Jansson_LIB})
set(JANSSON_VERSION ${_JANSSON_VERSION_STRING})
if(NOT TARGET Jansson::Jansson)
if(IS_ABSOLUTE "${JANSSON_LIBRARIES}")
add_library(Jansson::Jansson UNKNOWN IMPORTED GLOBAL)
set_target_properties(Jansson::Jansson PROPERTIES IMPORTED_LOCATION
"${JANSSON_LIBRARIES}")
else()
add_library(Jansson::Jansson INTERFACE IMPORTED GLOBAL)
set_target_properties(Jansson::Jansson PROPERTIES IMPORTED_LIBNAME
"${JANSSON_LIBRARIES}")
endif()
set_target_properties(
Jansson::Jansson PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${JANSSON_INCLUDE_DIRS}")
endif()
endif()

View File

@ -1,113 +1,151 @@
# Once done these will be defined:
#
# LIBAJANTV2_FOUND
# LIBAJANTV2_INCLUDE_DIRS
# LIBAJANTV2_LIBRARIES
# LIBAJANTV2_FOUND LIBAJANTV2_INCLUDE_DIRS LIBAJANTV2_LIBRARIES
#
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_AJA QUIET ajantv2)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_AJA QUIET ajantv2)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
set(_lib_suffix 32)
endif()
find_path(AJA_LIBRARIES_INCLUDE_DIR
NAMES ajalibraries
HINTS
ENV AJASDKPath${_lib_suffix}
ENV AJASDKPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${AJASDKPath${_lib_suffix}}
${AJASDKPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_AJA_NTV2_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES
include)
find_path(
AJA_LIBRARIES_INCLUDE_DIR
NAMES ajalibraries
HINTS ENV
AJASDKPath${_lib_suffix}
ENV
AJASDKPath
ENV
DepsPath${_lib_suffix}
ENV
DepsPath
${AJASDKPath${_lib_suffix}}
${AJASDKPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_AJA_NTV2_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES include)
find_library(AJA_NTV2_LIB
NAMES ${_AJA_NTV2_LIBRARIES} ajantv2 libajantv2
HINTS
ENV AJASDKPath${_lib_suffix}
ENV AJASDKPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${AJASDKPath${_lib_suffix}}
${AJASDKPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_AJA_NTV2_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
AJA_NTV2_LIB
NAMES ${_AJA_NTV2_LIBRARIES} ajantv2 libajantv2
HINTS ENV
AJASDKPath${_lib_suffix}
ENV
AJASDKPath
ENV
DepsPath${_lib_suffix}
ENV
DepsPath
${AJASDKPath${_lib_suffix}}
${AJASDKPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_AJA_NTV2_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
find_library(AJA_NTV2_DEBUG_LIB
NAMES ajantv2d libajantv2d
HINTS
ENV AJASDKPath${_lib_suffix}
ENV AJASDKPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${AJASDKPath${_lib_suffix}}
${AJASDKPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_AJA_NTV2_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
AJA_NTV2_DEBUG_LIB
NAMES ajantv2d libajantv2d
HINTS ENV
AJASDKPath${_lib_suffix}
ENV
AJASDKPath
ENV
DepsPath${_lib_suffix}
ENV
DepsPath
${AJASDKPath${_lib_suffix}}
${AJASDKPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_AJA_NTV2_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibAJANTV2 DEFAULT_MSG AJA_LIBRARIES_INCLUDE_DIR AJA_NTV2_LIB)
find_package_handle_standard_args(LibAJANTV2 DEFAULT_MSG
AJA_LIBRARIES_INCLUDE_DIR AJA_NTV2_LIB)
mark_as_advanced(AJA_LIBRARIES_INCLUDE_DIR AJA_NTV2_LIB)
if(LIBAJANTV2_FOUND)
set(AJA_LIBRARIES_INCLUDE_DIR
${AJA_LIBRARIES_INCLUDE_DIR}/ajalibraries)
set(AJA_LIBRARIES_INCLUDE_DIRS
${AJA_LIBRARIES_INCLUDE_DIR}
${AJA_LIBRARIES_INCLUDE_DIR}/ajaanc
${AJA_LIBRARIES_INCLUDE_DIR}/ajabase
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2/includes
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2/src)
if (WIN32)
set(AJA_LIBRARIES_INCLUDE_DIRS
${AJA_LIBRARIES_INCLUDE_DIRS}
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2/src/win)
elseif (APPLE)
set(AJA_LIBRARIES_INCLUDE_DIRS
${AJA_LIBRARIES_INCLUDE_DIRS}
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2/src/mac)
elseif(UNIX AND NOT APPLE)
set(AJA_LIBRARIES_INCLUDE_DIRS
${AJA_LIBRARIES_INCLUDE_DIRS}
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2/src/lin)
endif()
set(AJA_LIBRARIES_INCLUDE_DIR ${AJA_LIBRARIES_INCLUDE_DIR}/ajalibraries)
set(AJA_LIBRARIES_INCLUDE_DIRS
${AJA_LIBRARIES_INCLUDE_DIR} ${AJA_LIBRARIES_INCLUDE_DIR}/ajaanc
${AJA_LIBRARIES_INCLUDE_DIR}/ajabase ${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2
${AJA_LIBRARIES_INCLUDE_DIR}/ajantv2/includes)
set(LIBAJANTV2_LIBRARIES ${AJA_NTV2_LIB})
if(AJA_NTV2_DEBUG_LIB STREQUAL "AJA_NTV2_DEBUG_LIB-NOTFOUND")
set(AJA_NTV2_DEBUG_LIB ${AJA_NTV2_LIB})
endif()
set(LIBAJANTV2_DEBUG_LIBRARIES ${AJA_NTV2_DEBUG_LIB})
set(LIBAJANTV2_INCLUDE_DIRS ${AJA_LIBRARIES_INCLUDE_DIRS})
set(LIBAJANTV2_LIBRARIES ${AJA_NTV2_LIB})
if(AJA_NTV2_DEBUG_LIB STREQUAL "AJA_NTV2_DEBUG_LIB-NOTFOUND")
set(AJA_NTV2_DEBUG_LIB ${AJA_NTV2_LIB})
mark_as_advanced(AJA_NTV2_DEBUG_LIB)
endif()
set(LIBAJANTV2_DEBUG_LIBRARIES ${AJA_NTV2_DEBUG_LIB})
set(LIBAJANTV2_INCLUDE_DIRS ${AJA_LIBRARIES_INCLUDE_DIRS})
if(NOT TARGET AJA::LibAJANTV2)
if(IS_ABSOLUTE "${LIBAJANTV2_LIBRARIES}")
add_library(AJA::LibAJANTV2 UNKNOWN IMPORTED)
set_target_properties(
AJA::LibAJANTV2 PROPERTIES IMPORTED_LOCATION "${LIBAJANTV2_LIBRARIES}")
if(DEFINED LIBAJANTV2_DEBUG_LIBRARIES)
set_target_properties(
AJA::LibAJANTV2 PROPERTIES IMPORTED_LOCATION_DEBUG
"${LIBAJANTV2_DEBUG_LIBRARIES}")
endif()
else()
add_library(AJA::LibAJANTV2 INTERFACE IMPORTED)
set_target_properties(
AJA::LibAJANTV2 PROPERTIES IMPORTED_LIBNAME "${LIBAJANTV2_LIBRARIES}")
if(DEFINED LIBAJANTV2_DEBUG_LIBRARIES)
set_target_properties(
AJA::LibAJANTV2 PROPERTIES IMPORTED_LIBNAME_DEBUG
"${LIBAJANTV2_DEBUG_LIBRARIES}")
endif()
endif()
set_target_properties(
AJA::LibAJANTV2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${LIBAJANTV2_INCLUDE_DIRS}")
target_compile_definitions(
AJA::LibAJANTV2
INTERFACE "$<$<BOOL:${OS_WINDOWS}>:AJA_WINDOWS;_WINDOWS;WIN32;MSWindows>"
"$<$<AND:$<BOOL:${OS_WINDOWS}>,$<CONFIG:DEBUG>>:_DEBUG;_NDEBUG>"
"$<$<BOOL:${OS_MACOS}>:AJAMac;AJA_MAC>"
"$<$<BOOL:${OS_LINUX}>:AJA_LINUX;AJALinux>")
endif()
endif()

View File

@ -1,59 +1,46 @@
# Once done these will be defined:
#
# LIBVLC_FOUND
# LIBVLC_INCLUDE_DIRS
# LIBVLC_LIBRARIES
# LIBVLC_FOUND LIBVLC_INCLUDE_DIRS LIBVLC_LIBRARIES
#
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_VLC QUIET libvlc)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_VLC QUIET libvlc)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
set(_lib_suffix 32)
endif()
find_path(VLC_INCLUDE_DIR
NAMES libvlc.h
HINTS
ENV VLCPath${_lib_suffix}
ENV VLCPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${VLCPath${_lib_suffix}}
${VLCPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_VLC_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES
vlc include/vlc include)
find_path(
VLC_INCLUDE_DIR
NAMES libvlc.h
HINTS ENV VLC_PATH ${VLC_PATH} ${CMAKE_SOURCE_DIR}/${VLC_PATH}
${_VLC_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES vlc include/vlc include)
find_library(VLC_LIB
NAMES ${_VLC_LIBRARIES} VLC libVLC
HINTS
ENV VLCPath${_lib_suffix}
ENV VLCPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${VLCPath${_lib_suffix}}
${VLCPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_VLC_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
VLC_LIB
NAMES ${_VLC_LIBRARIES} VLC libVLC
HINTS ENV VLC_PATH ${VLC_PATH} ${CMAKE_SOURCE_DIR}/${VLC_PATH}
${_VLC_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
include(FindPackageHandleStandardArgs)
# OBS doesnt depend on linking, so we dont include VLC_LIB here as required.
@ -61,6 +48,12 @@ find_package_handle_standard_args(LibVLC DEFAULT_MSG VLC_INCLUDE_DIR)
mark_as_advanced(VLC_INCLUDE_DIR VLC_LIB)
if(LIBVLC_FOUND)
set(LIBVLC_LIBRARIES ${VLC_LIB})
set(LIBVLC_INCLUDE_DIRS ${VLC_INCLUDE_DIR})
set(LIBVLC_LIBRARIES ${VLC_LIB})
set(LIBVLC_INCLUDE_DIRS ${VLC_INCLUDE_DIR})
if(NOT TARGET VLC::LibVLC)
add_library(VLC::LibVLC INTERFACE IMPORTED)
set_target_properties(VLC::LibVLC PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${LIBVLC_INCLUDE_DIRS}")
endif()
endif()

View File

@ -1,86 +0,0 @@
# Once done these will be defined:
#
# LIBCURL_FOUND
# LIBCURL_INCLUDE_DIRS
# LIBCURL_LIBRARIES
#
# For use in OBS:
#
# CURL_INCLUDE_DIR
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_CURL QUIET curl libcurl)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
endif()
find_path(CURL_INCLUDE_DIR
NAMES curl/curl.h
HINTS
ENV curlPath${_lib_suffix}
ENV curlPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${curlPath${_lib_suffix}}
${curlPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_CURL_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES
include)
if(APPLE)
find_library(CURL_LIB
NAMES ${_CURL_LIBRARIES} curl libcurl
HINTS
ENV curlPath${_lib_suffix}
ENV curlPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${curlPath${_lib_suffix}}
${curlPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_CURL_LIBRARY_DIRS}
)
else()
find_library(CURL_LIB
NAMES ${_CURL_LIBRARIES} curl libcurl
HINTS
ENV curlPath${_lib_suffix}
ENV curlPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${curlPath${_lib_suffix}}
${curlPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_CURL_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin
"build/Win${_lib_suffix}/VC12/DLL Release - DLL Windows SSPI"
"../build/Win${_lib_suffix}/VC12/DLL Release - DLL Windows SSPI")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libcurl DEFAULT_MSG CURL_LIB CURL_INCLUDE_DIR)
mark_as_advanced(CURL_INCLUDE_DIR CURL_LIB)
if(LIBCURL_FOUND)
set(LIBCURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
set(LIBCURL_LIBRARIES ${CURL_LIB})
endif()

View File

@ -1,33 +1,37 @@
# Once done these will be defined:
#
# LIBDRM_FOUND
# LIBDRM_INCLUDE_DIRS
# LIBDRM_LIBRARIES
# LIBDRM_FOUND LIBDRM_INCLUDE_DIRS LIBDRM_LIBRARIES
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_LIBDRM QUIET libdrm)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_LIBDRM QUIET libdrm)
endif()
find_path(LIBDRM_INCLUDE_DIR
NAMES libdrm/drm_fourcc.h
HINTS
${_LIBDRM_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include)
find_path(
LIBDRM_INCLUDE_DIR
NAMES libdrm/drm_fourcc.h
HINTS ${_LIBDRM_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include)
find_library(LIBDRM_LIB
NAMES drm libdrm
HINTS
${_LIBDRM_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib)
find_library(
LIBDRM_LIB
NAMES drm libdrm
HINTS ${_LIBDRM_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libdrm DEFAULT_MSG LIBDRM_LIB LIBDRM_INCLUDE_DIR)
find_package_handle_standard_args(Libdrm DEFAULT_MSG LIBDRM_LIB
LIBDRM_INCLUDE_DIR)
mark_as_advanced(LIBDRM_INCLUDE_DIR LIBDRM_LIB)
if(LIBDRM_FOUND)
set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR})
set(LIBDRM_LIBRARIES ${LIBDRM_LIB})
set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR})
set(LIBDRM_LIBRARIES ${LIBDRM_LIB})
if(NOT TARGET Libdrm::Libdrm)
add_library(Libdrm::Libdrm INTERFACE IMPORTED)
set_target_properties(
Libdrm::Libdrm PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${LIBDRM_INCLUDE_DIRS}")
endif()
endif()

View File

@ -1,68 +1,73 @@
# Once done these will be defined:
#
# LIBFDK_FOUND
# LIBFDK_INCLUDE_DIRS
# LIBFDK_LIBRARIES
# LIBFDK_FOUND LIBFDK_INCLUDE_DIRS LIBFDK_LIBRARIES
#
# For use in OBS:
# For use in OBS:
#
# Libfdk_INCLUDE_DIR
# Libfdk_INCLUDE_DIR
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_LIBFDK QUIET fdk-aac)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_LIBFDK fdk-aac)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
set(_lib_suffix 32)
endif()
find_path(Libfdk_INCLUDE_DIR
NAMES fdk-aac/aacenc_lib.h
HINTS
ENV LibfdkPath${_lib_suffix}
ENV LibfdkPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${LibfdkPath${_lib_suffix}}
${LibfdkPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_LIBFDK_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES
include)
find_path(
Libfdk_INCLUDE_DIR
NAMES fdk-aac/aacenc_lib.h
HINTS ENV LIBFDK_PATH ${LIBFDK_PATH} ${CMAKE_SOURCE_DIR}/${LIBFDK_PATH}
${_LIBFDK_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES include)
find_library(Libfdk_LIB
NAMES ${_LIBFDK_LIBRARIES} fdk-aac libfdk-aac
HINTS
ENV LibfdkPath${_lib_suffix}
ENV LibfdkPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${LibfdkPath${_lib_suffix}}
${LibfdkPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_LIBFDK_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
Libfdk_LIB
NAMES ${_LIBFDK_LIBRARIES} fdk-aac libfdk-aac
HINTS ENV LIBFDK_PATH ${LIBFDK_PATH} ${CMAKE_SOURCE_DIR}/${LIBFDK_PATH}
${_LIBFDK_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libfdk DEFAULT_MSG Libfdk_LIB Libfdk_INCLUDE_DIR)
find_package_handle_standard_args(Libfdk DEFAULT_MSG Libfdk_LIB
Libfdk_INCLUDE_DIR)
mark_as_advanced(Libfdk_INCLUDE_DIR Libfdk_LIB)
if(LIBFDK_FOUND)
set(LIBFDK_INCLUDE_DIRS ${Libfdk_INCLUDE_DIR})
set(LIBFDK_LIBRARIES ${Libfdk_LIB})
set(LIBFDK_INCLUDE_DIRS ${Libfdk_INCLUDE_DIR})
set(LIBFDK_LIBRARIES ${Libfdk_LIB})
if(NOT TARGET LibFDK::LibFDK)
if(IS_ABSOLUTE "${LIBFDK_LIBRARIES}")
add_library(LibFDK::LibFDK UNKNOWN IMPORTED)
set_target_properties(LibFDK::LibFDK PROPERTIES IMPORTED_LOCATION
"${LIBFDK_LIBRARIES}")
else()
add_library(LibFDK::LibFDK INTERFACE IMPORTED)
set_target_properties(LibFDK::LibFDK PROPERTIES IMPORTED_LIBNAME
"${LIBFDK_LIBRARIES}")
endif()
set_target_properties(
LibFDK::LibFDK PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${LIBFDK_INCLUDE_DIRS}")
endif()
endif()

View File

@ -1,10 +1,9 @@
# * Try to find Libpci
# Once done this will define
# * Try to find Libpci Once done this will define
#
# LIBPCI_FOUND - system has Libpci
# LIBPCI_INCLUDE_DIRS - the Libpci include directory
# LIBPCI_LIBRARIES - the libraries needed to use Libpci
# LIBPCI_DEFINITIONS - Compiler switches required for using Libpci
# * LIBPCI_FOUND - system has Libpci
# * LIBPCI_INCLUDE_DIRS - the Libpci include directory
# * LIBPCI_LIBRARIES - the libraries needed to use Libpci
# * LIBPCI_DEFINITIONS - Compiler switches required for using Libpci
# Use pkg-config to get the directories and then use these values in the
# find_path() and find_library() calls
@ -28,7 +27,8 @@ find_library(
PATHS /usr/lib /usr/local/lib /opt/local/lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libpci REQUIRED_VARS LIBPCI_LIB LIBPCI_INCLUDE_DIR)
find_package_handle_standard_args(Libpci REQUIRED_VARS LIBPCI_LIB
LIBPCI_INCLUDE_DIR)
mark_as_advanced(LIBPCI_INCLUDE_DIR LIBPCI_LIB)
if(LIBPCI_FOUND)
@ -39,11 +39,11 @@ if(LIBPCI_FOUND)
if(IS_ABSOLUTE "${LIBPCI_LIBRARIES}")
add_library(LIBPCI::LIBPCI UNKNOWN IMPORTED)
set_target_properties(LIBPCI::LIBPCI PROPERTIES IMPORTED_LOCATION
"${LIBPCI_LIBRARIES}")
"${LIBPCI_LIBRARIES}")
else()
add_library(LIBPCI::LIBPCI INTERFACE IMPORTED)
set_target_properties(LIBPCI::LIBPCI PROPERTIES IMPORTED_LIBNAME
"${LIBPCI_LIBRARIES}")
"${LIBPCI_LIBRARIES}")
endif()
endif()
endif()

View File

@ -1,68 +1,74 @@
# Once done these will be defined:
#
# LIBRNNOISE_FOUND
# LIBRNNOISE_INCLUDE_DIRS
# LIBRNNOISE_LIBRARIES
# LIBRNNOISE_FOUND LIBRNNOISE_INCLUDE_DIRS LIBRNNOISE_LIBRARIES
#
# For use in OBS:
#
# RNNOISE_INCLUDE_DIR
# RNNOISE_INCLUDE_DIR
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_RNNOISE QUIET rnnoise)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_RNNOISE QUIET rnnoise)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
set(_lib_suffix 32)
endif()
find_path(RNNOISE_INCLUDE_DIR
NAMES rnnoise.h
HINTS
ENV rnnoisePath${_lib_suffix}
ENV rnnoisePath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${rnnoisePath${_lib_suffix}}
${rnnoisePath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_RNNOISE_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES
include)
find_path(
RNNOISE_INCLUDE_DIR
NAMES rnnoise.h
HINTS ENV RNNOISE_PATH ${RNNOISE_PATH} ${CMAKE_SOURCE_DIR}/${RNNOISE_PATH}
${_RNNOISE_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES include)
find_library(RNNOISE_LIB
NAMES ${_RNNOISE_LIBRARIES} rnnoise
HINTS
ENV rnnoisePath${_lib_suffix}
ENV rnnoisePath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${rnnoisePath${_lib_suffix}}
${rnnoisePath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_RNNOISE_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
RNNOISE_LIB
NAMES ${_RNNOISE_LIBRARIES} rnnoise
HINTS ENV RNNOISE_PATH ${RNNOISE_PATH} ${CMAKE_SOURCE_DIR}/${RNNOISE_PATH}
${_RNNOISE_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Librnnoise DEFAULT_MSG RNNOISE_LIB RNNOISE_INCLUDE_DIR)
find_package_handle_standard_args(Librnnoise DEFAULT_MSG RNNOISE_LIB
RNNOISE_INCLUDE_DIR)
mark_as_advanced(RNNOISE_INCLUDE_DIR RNNOISE_LIB)
if(LIBRNNOISE_FOUND)
set(LIBRNNOISE_INCLUDE_DIRS ${RNNOISE_INCLUDE_DIR})
set(LIBRNNOISE_LIBRARIES ${RNNOISE_LIB})
set(LIBRNNOISE_INCLUDE_DIRS ${RNNOISE_INCLUDE_DIR})
set(LIBRNNOISE_LIBRARIES ${RNNOISE_LIB})
if(NOT TARGET Librnnoise::Librnnoise)
if(IS_ABSOLUTE "${LIBRNNOISE_LIBRARIES}")
add_library(Librnnoise::Librnnoise UNKNOWN IMPORTED)
set_target_properties(
Librnnoise::Librnnoise PROPERTIES IMPORTED_LOCATION
"${LIBRNNOISE_LIBRARIES}")
else()
add_library(Librnnoise::Librnnoise INTERFACE IMPORTED)
set_target_properties(
Librnnoise::Librnnoise PROPERTIES IMPORTED_LIBNAME
"${LIBRNNOISE_LIBRARIES}")
endif()
set_target_properties(
Librnnoise::Librnnoise PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${LIBRNNOISE_INCLUDE_DIRS}")
endif()
endif()

View File

@ -1,68 +1,74 @@
# Once done these will be defined:
#
# LIBSPEEXDSP_FOUND
# LIBSPEEXDSP_INCLUDE_DIRS
# LIBSPEEXDSP_LIBRARIES
# LIBSPEEXDSP_FOUND LIBSPEEXDSP_INCLUDE_DIRS LIBSPEEXDSP_LIBRARIES
#
# For use in OBS:
#
# SPEEXDSP_INCLUDE_DIR
# SPEEXDSP_INCLUDE_DIR
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_SPEEXDSP QUIET speexdsp libspeexdsp)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_SPEEXDSP QUIET speexdsp libspeexdsp)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
set(_lib_suffix 32)
endif()
find_path(SPEEXDSP_INCLUDE_DIR
NAMES speex/speex_preprocess.h
HINTS
ENV speexPath${_lib_suffix}
ENV speexPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${speexPath${_lib_suffix}}
${speexPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_SPEEXDSP_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES
include)
find_path(
SPEEXDSP_INCLUDE_DIR
NAMES speex/speex_preprocess.h
HINTS ENV SPEEX_PATH ${SPEEX_PATH} ${CMAKE_SOURCE_DIR}/${SPEEX_PATH}
${_SPEEXDSP_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES include)
find_library(SPEEXDSP_LIB
NAMES ${_SPEEXDSP_LIBRARIES} speexdsp libspeexdsp
HINTS
ENV speexPath${_lib_suffix}
ENV speexPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${speexPath${_lib_suffix}}
${speexPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_SPEEXDSP_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
SPEEXDSP_LIB
NAMES ${_SPEEXDSP_LIBRARIES} speexdsp libspeexdsp
HINTS ENV SPEEX_PATH ${SPEEX_PATH} ${CMAKE_SOURCE_DIR}/${SPEEX_PATH}
${_SPEEXDSP_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libspeexdsp DEFAULT_MSG SPEEXDSP_LIB SPEEXDSP_INCLUDE_DIR)
find_package_handle_standard_args(Libspeexdsp DEFAULT_MSG SPEEXDSP_LIB
SPEEXDSP_INCLUDE_DIR)
mark_as_advanced(SPEEXDSP_INCLUDE_DIR SPEEXDSP_LIB)
if(LIBSPEEXDSP_FOUND)
set(LIBSPEEXDSP_INCLUDE_DIRS ${SPEEXDSP_INCLUDE_DIR})
set(LIBSPEEXDSP_LIBRARIES ${SPEEXDSP_LIB})
set(LIBSPEEXDSP_INCLUDE_DIRS ${SPEEXDSP_INCLUDE_DIR})
set(LIBSPEEXDSP_LIBRARIES ${SPEEXDSP_LIB})
if(NOT TARGET LibspeexDSP::LibspeexDSP)
if(IS_ABSOLUTE "${LIBSPEEXDSP_LIBRARIES}")
add_library(LibspeexDSP::LibspeexDSP UNKNOWN IMPORTED)
set_target_properties(
LibspeexDSP::LibspeexDSP PROPERTIES IMPORTED_LOCATION
"${LIBSPEEXDSP_LIBRARIES}")
else()
add_library(LibspeexDSP::LibspeexDSP INTERFACE IMPORTED)
set_target_properties(
LibspeexDSP::LibspeexDSP PROPERTIES IMPORTED_LIBNAME
"${LIBSPEEXDSP_LIBRARIES}")
endif()
set_target_properties(
LibspeexDSP::LibspeexDSP PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${LIBSPEEXDSP_INCLUDE_DIRS}")
endif()
endif()

View File

@ -1,24 +0,0 @@
# Once done these will be defined:
#
# SYSINFO_FOUND
# SYSINFO_INCLUDE_DIRS
# SYSINFO_LIBRARIES
find_path(SYSINFO_INCLUDE_DIR
NAMES sys/sysinfo.h
PATHS
/usr/include /usr/local/include /opt/local/include)
find_library(SYSINFO_LIB
NAMES sysinfo libsysinfo
PATHS
/usr/lib /usr/local/lib /opt/local/lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(sysinfo DEFAULT_MSG SYSINFO_LIB SYSINFO_INCLUDE_DIR)
mark_as_advanced(SYSINFO_INCLUDE_DIR SYSINFO_LIB)
if(SYSINFO_FOUND)
set(SYSINFO_INCLUDE_DIRS ${SYSINFO_INCLUDE_DIR})
set(SYSINFO_LIBRARIES ${SYSINFO_LIB})
endif()

View File

@ -1,33 +1,45 @@
# Once done these will be defined:
#
# LIBV4L2_FOUND
# LIBV4L2_INCLUDE_DIRS
# LIBV4L2_LIBRARIES
# LIBV4L2_FOUND LIBV4L2_INCLUDE_DIRS LIBV4L2_LIBRARIES
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_V4L2 QUIET v4l-utils)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_V4L2 QUIET v4l-utils)
endif()
find_path(V4L2_INCLUDE_DIR
NAMES libv4l2.h
HINTS
${_V4L2_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include)
find_path(
V4L2_INCLUDE_DIR
NAMES libv4l2.h
HINTS ${_V4L2_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include)
find_library(V4L2_LIB
NAMES v4l2
HINTS
${_V4L2_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib)
find_library(
V4L2_LIB
NAMES v4l2
HINTS ${_V4L2_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libv4l2 DEFAULT_MSG V4L2_LIB V4L2_INCLUDE_DIR)
mark_as_advanced(V4L2_INCLUDE_DIR V4L2_LIB)
if(LIBV4L2_FOUND)
set(LIBV4L2_INCLUDE_DIRS ${V4L2_INCLUDE_DIR})
set(LIBV4L2_LIBRARIES ${V4L2_LIB})
set(LIBV4L2_INCLUDE_DIRS ${V4L2_INCLUDE_DIR})
set(LIBV4L2_LIBRARIES ${V4L2_LIB})
if(NOT TARGET LIB4L2::LIB4L2)
if(IS_ABSOLUTE "${LIBV4L2_LIBRARIES}")
add_library(LIB4L2::LIB4L2 UNKNOWN IMPORTED)
set_target_properties(LIB4L2::LIB4L2 PROPERTIES IMPORTED_LOCATION
"${LIBV4L2_LIBRARIES}")
else()
add_library(LIB4L2::LIB4L2 INTERFACE IMPORTED)
set_target_properties(LIB4L2::LIB4L2 PROPERTIES IMPORTED_LIBNAME
"${LIBV4L2_LIBRARIES}")
endif()
set_target_properties(
LIB4L2::LIB4L2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${LIBV4L2_INCLUDE_DIRS}")
endif()
endif()

View File

@ -1,68 +1,71 @@
# Once done these will be defined:
#
# LIBX264_FOUND
# LIBX264_INCLUDE_DIRS
# LIBX264_LIBRARIES
# LIBX264_FOUND LIBX264_INCLUDE_DIRS LIBX264_LIBRARIES
#
# For use in OBS:
# For use in OBS:
#
# X264_INCLUDE_DIR
# X264_INCLUDE_DIR
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_X264 QUIET x264)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_X264 QUIET x264)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
set(_lib_suffix 32)
endif()
find_path(X264_INCLUDE_DIR
NAMES x264.h
HINTS
ENV x264Path${_lib_suffix}
ENV x264Path
ENV DepsPath${_lib_suffix}
ENV DepsPath
${x264Path${_lib_suffix}}
${x264Path}
${DepsPath${_lib_suffix}}
${DepsPath}
${_X264_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES
include)
find_path(
X264_INCLUDE_DIR
NAMES x264.h
HINTS ENV X264_PATH ${X264_PATH} ${CMAKE_SOURCE_DIR}/${X264_PATH}
${_X264_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES include)
find_library(X264_LIB
NAMES ${_X264_LIBRARIES} x264 libx264
HINTS
ENV x264Path${_lib_suffix}
ENV x264Path
ENV DepsPath${_lib_suffix}
ENV DepsPath
${x264Path${_lib_suffix}}
${x264Path}
${DepsPath${_lib_suffix}}
${DepsPath}
${_X264_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
X264_LIB
NAMES ${_X264_LIBRARIES} x264 libx264
HINTS ENV X264_PATH ${X264_PATH} ${CMAKE_SOURCE_DIR}/${X264_PATH}
${_X264_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libx264 DEFAULT_MSG X264_LIB X264_INCLUDE_DIR)
mark_as_advanced(X264_INCLUDE_DIR X264_LIB)
if(LIBX264_FOUND)
set(LIBX264_INCLUDE_DIRS ${X264_INCLUDE_DIR})
set(LIBX264_LIBRARIES ${X264_LIB})
set(LIBX264_INCLUDE_DIRS ${X264_INCLUDE_DIR})
set(LIBX264_LIBRARIES ${X264_LIB})
if(NOT TARGET LIBX264::LIBX264)
if(IS_ABSOLUTE "${LIBX264_LIBRARIES}")
add_library(LIBX264::LIBX264 UNKNOWN IMPORTED)
set_target_properties(LIBX264::LIBX264 PROPERTIES IMPORTED_LOCATION
"${LIBX264_LIBRARIES}")
else()
add_library(LIBX264::LIBX264 INTERFACE IMPORTED)
set_target_properties(LIBX264::LIBX264 PROPERTIES IMPORTED_LIBNAME
"${LIBX264_LIBRARIES}")
endif()
set_target_properties(
LIBX264::LIBX264 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${LIBX264_INCLUDE_DIRS}")
endif()
endif()

View File

@ -1,88 +1,92 @@
# Once done these will be defined:
#
# LUAJIT_FOUND
# LUAJIT_INCLUDE_DIRS
# LUAJIT_LIBRARIES
# LUAJIT_FOUND LUAJIT_INCLUDE_DIRS LUAJIT_LIBRARIES
#
# For use in OBS:
# For use in OBS:
#
# LUAJIT_INCLUDE_DIR
# LUAJIT_INCLUDE_DIR
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(_LIB_SUFFIX 64)
ELSE()
SET(_LIB_SUFFIX 32)
ENDIF()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_LIB_SUFFIX 64)
else()
set(_LIB_SUFFIX 32)
endif()
FIND_PATH(LUAJIT_INCLUDE_DIR
NAMES lua.h lualib.h
HINTS
ENV LuajitPath${_LIB_SUFFIX}
ENV LuajitPath
ENV DepsPath${_LIB_SUFFIX}
ENV DepsPath
${LuajitPath${_LIB_SUFFIX}}
${LuajitPath}
${DepsPath${_LIB_SUFFIX}}
${DepsPath}
${_LUAJIT_INCLUDE_DIRS}
PATHS
/usr/include
/usr/local/include
/opt/local/include
/opt/local
/sw/include
~/Library/Frameworks
/Library/Frameworks
PATH_SUFFIXES
include
luajit
luajit/src
include/luajit
include/luajit/src
luajit-2.0
include/luajit-2.0
luajit2.0
include/luajit2.0
luajit-2.1
include/luajit-2.1
luajit2.1
include/luajit2.1
)
find_path(
LUAJIT_INCLUDE_DIR
NAMES lua.h lualib.h
HINTS ENV LUAJIT_PATH ${LUAJIT_PATH} ${CMAKE_SOURCE_DIR}/${LUAJIT_PATH}
${_LUAJIT_INCLUDE_DIRS}
PATHS /usr/include
/usr/local/include
/opt/local/include
/opt/local
/sw/include
~/Library/Frameworks
/Library/Frameworks
PATH_SUFFIXES
include
luajit
luajit/src
include/luajit
include/luajit/src
luajit-2.0
include/luajit-2.0
luajit2.0
include/luajit2.0
luajit-2.1
include/luajit-2.1
luajit2.1
include/luajit2.1)
find_library(LUAJIT_LIB
NAMES ${_LUAJIT_LIBRARIES} luajit luajit-51 luajit-5.1 lua51
HINTS
ENV LuajitPath${_lib_suffix}
ENV LuajitPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${LuajitPath${_lib_suffix}}
${LuajitPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_LUAJIT_LIBRARY_DIRS}
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/opt/local
/sw/lib
~/Library/Frameworks
/Library/Frameworks
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
LUAJIT_LIB
NAMES ${_LUAJIT_LIBRARIES} luajit luajit-51 luajit-5.1 lua51
HINTS ENV LUAJIT_PATH ${LUAJIT_PATH} ${CMAKE_SOURCE_DIR}/${LUAJIT_PATH}
${_LUAJIT_LIBRARY_DIRS}
PATHS /usr/lib
/usr/local/lib
/opt/local/lib
/opt/local
/sw/lib
~/Library/Frameworks
/Library/Frameworks
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Luajit DEFAULT_MSG LUAJIT_LIB LUAJIT_INCLUDE_DIR)
find_package_handle_standard_args(Luajit DEFAULT_MSG LUAJIT_LIB
LUAJIT_INCLUDE_DIR)
mark_as_advanced(LUAJIT_INCLUDE_DIR LUAJIT_LIB)
if(LUAJIT_FOUND)
set(LUAJIT_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIR})
set(LUAJIT_LIBRARIES ${LUAJIT_LIB})
set(LUAJIT_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIR})
set(LUAJIT_LIBRARIES ${LUAJIT_LIB})
if(NOT TARGET Luajit::Luajit)
if(IS_ABSOLUTE "${LUAJIT_LIBRARIES}")
add_library(Luajit::Luajit UNKNOWN IMPORTED)
set_target_properties(Luajit::Luajit PROPERTIES IMPORTED_LOCATION
"${LUAJIT_LIBRARIES}")
else()
add_library(Luajit::Luajit INTERFACE IMPORTED)
set_target_properties(Luajit::Luajit PROPERTIES IMPORTED_LIBNAME
"${LUAJIT_LIBRARIES}")
endif()
set_target_properties(
Luajit::Luajit PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${LUAJIT_INCLUDE_DIRS}")
endif()
endif()

View File

@ -1,137 +1,173 @@
# Once done these will be defined:
#
# MBEDTLS_FOUND
# MBEDTLS_INCLUDE_DIRS
# MBEDTLS_LIBRARIES
# * MBEDTLS_FOUND
# * MBEDTLS_INCLUDE_DIRS
# * MBEDTLS_LIBRARIES
#
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_MBEDTLS QUIET mbedtls)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_MBEDTLS QUIET mbedtls)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
set(_lib_suffix 32)
endif()
# If we're on MacOS or Linux, please try to statically-link mbedtls.
if(STATIC_MBEDTLS AND (APPLE OR UNIX))
set(_MBEDTLS_LIBRARIES libmbedtls.a)
set(_MBEDCRYPTO_LIBRARIES libmbedcrypto.a)
set(_MBEDX509_LIBRARIES libmbedx509.a)
if(ENABLE_STATIC_MBEDTLS AND (APPLE OR UNIX))
set(_MBEDTLS_LIBRARIES libmbedtls.a)
set(_MBEDCRYPTO_LIBRARIES libmbedcrypto.a)
set(_MBEDX509_LIBRARIES libmbedx509.a)
endif()
find_path(MBEDTLS_INCLUDE_DIR
NAMES mbedtls/ssl.h
HINTS
ENV mbedtlsPath${_lib_suffix}
ENV mbedtlsPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${mbedtlsPath${_lib_suffix}}
${mbedtlsPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_MBEDTLS_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES
include)
find_path(
MBEDTLS_INCLUDE_DIR
NAMES mbedtls/ssl.h
HINTS ENV MBEDTLS_PATH ${MBEDTLS_PATH} ${CMAKE_SOURCE_DIR}/${MBEDTLS_PATH}
${_MBEDTLS_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES include)
find_library(MBEDTLS_LIB
NAMES ${_MBEDTLS_LIBRARIES} mbedtls libmbedtls
HINTS
ENV mbedtlsPath${_lib_suffix}
ENV mbedtlsPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${mbedtlsPath${_lib_suffix}}
${mbedtlsPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_MBEDTLS_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
MBEDTLS_LIB
NAMES ${_MBEDTLS_LIBRARIES} mbedtls libmbedtls
HINTS ENV MBEDTLS_PATH ${MBEDTLS_PATH} ${CMAKE_SOURCE_DIR}/${MBEDTLS_PATH}
${_MBEDTLS_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
find_library(MBEDCRYPTO_LIB
NAMES ${_MBEDCRYPTO_LIBRARIES} mbedcrypto libmbedcrypto
HINTS
ENV mbedcryptoPath${_lib_suffix}
ENV mbedcryptoPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${mbedcryptoPath${_lib_suffix}}
${mbedcryptoPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_MBEDCRYPTO_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
MBEDCRYPTO_LIB
NAMES ${_MBEDCRYPTO_LIBRARIES} mbedcrypto libmbedcrypto
HINTS ENV MBEDCRYPTO_PATH ${MBEDCRYPTO_PATH}
${CMAKE_SOURCE_DIR}/${MBEDCRYPTO_PATH} ${_MBEDCRYPTO_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
find_library(MBEDX509_LIB
NAMES ${_MBEDX509_LIBRARIES} mbedx509 libmbedx509
HINTS
ENV mbedx509Path${_lib_suffix}
ENV mbedx509Path
ENV DepsPath${_lib_suffix}
ENV DepsPath
${mbedx509Path${_lib_suffix}}
${mbedx509Path}
${DepsPath${_lib_suffix}}
${DepsPath}
${_MBEDX509_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
find_library(
MBEDX509_LIB
NAMES ${_MBEDX509_LIBRARIES} mbedx509 libmbedx509
HINTS ENV MBEDX509_PATH ${MBEDX509_PATH} ${CMAKE_SOURCE_DIR}/${MBEDX509_PATH}
${_MBEDX509_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
PATH_SUFFIXES
lib${_lib_suffix}
lib
libs${_lib_suffix}
libs
bin${_lib_suffix}
bin
../lib${_lib_suffix}
../lib
../libs${_lib_suffix}
../libs
../bin${_lib_suffix}
../bin)
# Sometimes mbedtls is split between three libs, and sometimes it isn't.
# If it isn't, let's check if the symbols we need are all in MBEDTLS_LIB.
if(MBEDTLS_LIB AND NOT MBEDCRYPTO_LIB AND NOT MBEDX509_LIB)
set(CMAKE_REQUIRED_LIBRARIES ${MBEDTLS_LIB})
set(CMAKE_REQUIRED_INCLUDES ${MBEDTLS_INCLUDE_DIR})
check_symbol_exists(mbedtls_x509_crt_init "mbedtls/x509_crt.h" MBEDTLS_INCLUDES_X509)
check_symbol_exists(mbedtls_sha256_init "mbedtls/sha256.h" MBEDTLS_INCLUDES_CRYPTO)
unset(CMAKE_REQUIRED_INCLUDES)
unset(CMAKE_REQUIRED_LIBRARIES)
# Sometimes mbedtls is split between three libs, and sometimes it isn't. If it
# isn't, let's check if the symbols we need are all in MBEDTLS_LIB.
if(MBEDTLS_LIB
AND NOT MBEDCRYPTO_LIB
AND NOT MBEDX509_LIB)
set(CMAKE_REQUIRED_LIBRARIES ${MBEDTLS_LIB})
set(CMAKE_REQUIRED_INCLUDES ${MBEDTLS_INCLUDE_DIR})
check_symbol_exists(mbedtls_x509_crt_init "mbedtls/x509_crt.h"
MBEDTLS_INCLUDES_X509)
check_symbol_exists(mbedtls_sha256_init "mbedtls/sha256.h"
MBEDTLS_INCLUDES_CRYPTO)
unset(CMAKE_REQUIRED_INCLUDES)
unset(CMAKE_REQUIRED_LIBRARIES)
endif()
# If we find all three libraries, then go ahead.
if(MBEDTLS_LIB AND MBEDCRYPTO_LIB AND MBEDX509_LIB)
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIB} ${MBEDCRYPTO_LIB} ${MBEDX509_LIB})
if(MBEDTLS_LIB
AND MBEDCRYPTO_LIB
AND MBEDX509_LIB)
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIB} ${MBEDCRYPTO_LIB} ${MBEDX509_LIB})
# Otherwise, if we find MBEDTLS_LIB, and it has both CRYPTO and x509
# within the single lib (i.e. a windows build environment), then also
# feel free to go ahead.
elseif(MBEDTLS_LIB AND MBEDTLS_INCLUDES_CRYPTO AND MBEDTLS_INCLUDES_X509)
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIB})
foreach(component TLS CRYPTO X509)
if(NOT TARGET Mbedtls::${component} AND MBED${component}_LIB)
if(IS_ABSOLUTE "${MBED${component}_LIB}")
add_library(Mbedtls::${component} UNKNOWN IMPORTED)
set_target_properties(
Mbedtls::${component} PROPERTIES IMPORTED_LOCATION
"${MBED${component}_LIB}")
else()
add_library(Mbedtls::${component} INTERFACE IMPORTED)
set_target_properties(
Mbedtls::${component} PROPERTIES IMPORTED_LIBNAME
"${MBED${component}_LIB}")
endif()
set_target_properties(
Mbedtls::${component} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${MBED${component}_INCLUDE_DIR}")
endif()
endforeach()
if(NOT TARGET Mbedtls::Mbedtls)
add_library(Mbedtls::Mbedtls INTERFACE IMPORTED)
target_link_libraries(Mbedtls::Mbedtls
INTERFACE Mbedtls::TLS Mbedtls::CRYPTO Mbedtls::X509)
endif()
# Otherwise, if we find MBEDTLS_LIB, and it has both CRYPTO and x509 within
# the single lib (i.e. a windows build environment), then also feel free to go
# ahead.
elseif(
MBEDTLS_LIB
AND MBEDTLS_INCLUDES_CRYPTO
AND MBEDTLS_INCLUDES_X509)
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIB})
if(NOT TARGET Mbedtls::Mbedtls)
if(IS_ABSOLUTE "${MBED${component}_LIB}")
add_library(Mbedtls::${component} UNKNOWN IMPORTED)
set_target_properties(Mbedtls::${component}
PROPERTIES IMPORTED_LOCATION "${MBEDTLS_LIBRARIES}")
else()
add_library(Mbedtls::${component} INTERFACE IMPORTED)
set_target_properties(Mbedtls::${component}
PROPERTIES IMPORTED_LIBNAME "${MBEDTLS_LIBRARIES}")
endif()
set_target_properties(
Mbedtls::${component} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${MBEDTLS_INCLUDE_DIRS}")
endif()
endif()
# Now we've accounted for the 3-vs-1 library case:
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MbedTLS DEFAULT_MSG MBEDTLS_LIBRARIES MBEDTLS_INCLUDE_DIRS)
find_package_handle_standard_args(MbedTLS DEFAULT_MSG MBEDTLS_LIBRARIES
MBEDTLS_INCLUDE_DIRS)
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIB MBEDCRYPTO_LIB MBEDX509_LIB)

View File

@ -1,33 +1,36 @@
# Try to find OSS on a *nix system
#
# OSS_FOUND - True if OSS is available
# OSS_INCLUDE_DIR - Include directory of OSS header
# OSS_HEADER_NAME - OSS header file name
# OSS_FOUND - True if OSS is available OSS_INCLUDE_DIR - Include
# directory of OSS header OSS_HEADER_NAME - OSS header file name
#
IF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
set(OSS_HEADER_NAME "sys/soundcard.h")
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "DragonFly")
set(OSS_HEADER_NAME "sys/soundcard.h")
ENDIF()
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
set(OSS_HEADER_NAME "sys/soundcard.h")
elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly")
set(OSS_HEADER_NAME "sys/soundcard.h")
endif()
find_path(OSS_INCLUDE_DIR "${OSS_HEADER_NAME}"
"/usr/include"
"/usr/local/include"
)
find_path(OSS_INCLUDE_DIR "${OSS_HEADER_NAME}" "/usr/include"
"/usr/local/include")
if (OSS_INCLUDE_DIR)
set(OSS_FOUND True)
else (OSS_INCLUDE_DIR)
set(OSS_FOUND)
endif (OSS_INCLUDE_DIR)
if(OSS_INCLUDE_DIR)
set(OSS_FOUND True)
else(OSS_INCLUDE_DIR)
set(OSS_FOUND)
endif(OSS_INCLUDE_DIR)
if (OSS_FOUND)
message(STATUS "Found OSS header: ${OSS_INCLUDE_DIR}/${OSS_HEADER_NAME}")
else (OSS_FOUND)
if (OSS_FIND_REQUIRED)
message(FATAL_ERROR "Could not find OSS header file")
endif (OSS_FIND_REQUIRED)
endif (OSS_FOUND)
if(OSS_FOUND)
message(STATUS "Found OSS header: ${OSS_INCLUDE_DIR}/${OSS_HEADER_NAME}")
else(OSS_FOUND)
if(OSS_FIND_REQUIRED)
message(FATAL_ERROR "Could not find OSS header file")
endif(OSS_FIND_REQUIRED)
endif(OSS_FOUND)
mark_as_advanced(OSS_FOUND OSS_INCLUDE_DIR OSS_HEADER_NAME)
if(OSS_FOUND AND NOT TARGET OSS::OSS)
add_library(OSS::OSS INTERFACE IMPORTED)
set_target_properties(OSS::OSS PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${OSS_INCLUDE_DIR}")
endif()

View File

@ -1,65 +1,56 @@
#.rst:
# FindPipeWire
# .rst: FindPipeWire
# -------
#
# Try to find PipeWire on a Unix system.
#
# This will define the following variables:
#
# ``PIPEWIRE_FOUND``
# True if (the requested version of) PipeWire is available
# ``PIPEWIRE_VERSION``
# The version of PipeWire
# ``PIPEWIRE_LIBRARIES``
# This can be passed to target_link_libraries() instead of the ``PipeWire::PipeWire``
# target
# ``PIPEWIRE_INCLUDE_DIRS``
# This should be passed to target_include_directories() if the target is not
# used for linking
# ``PIPEWIRE_DEFINITIONS``
# This should be passed to target_compile_options() if the target is not
# used for linking
# ``PIPEWIRE_FOUND`` True if (the requested version of) PipeWire is available
# ``PIPEWIRE_VERSION`` The version of PipeWire ``PIPEWIRE_LIBRARIES`` This can
# be passed to target_link_libraries() instead of the ``PipeWire::PipeWire``
# target ``PIPEWIRE_INCLUDE_DIRS`` This should be passed to
# target_include_directories() if the target is not used for linking
# ``PIPEWIRE_DEFINITIONS`` This should be passed to target_compile_options() if
# the target is not used for linking
#
# If ``PIPEWIRE_FOUND`` is TRUE, it will also define the following imported target:
# If ``PIPEWIRE_FOUND`` is TRUE, it will also define the following imported
# target:
#
# ``PipeWire::PipeWire``
# The PipeWire library
# ``PipeWire::PipeWire`` The PipeWire library
#
# In general we recommend using the imported target, as it is easier to use.
# Bear in mind, however, that if the target is in the link interface of an
# exported library, it must be made available by the package config file.
#=============================================================================
# Copyright 2014 Alex Merry <alex.merry@kde.org>
# Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
# Copyright 2018-2020 Jan Grulich <jgrulich@redhat.com>
# =============================================================================
# Copyright 2014 Alex Merry <alex.merry@kde.org> Copyright 2014 Martin Gräßlin
# <mgraesslin@kde.org> Copyright 2018-2020 Jan Grulich <jgrulich@redhat.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 1. Redistributions of source code must retain the copyright notice, this list
# of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# =============================================================================
# Use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
# Use pkg-config to get the directories and then use these values in the
# FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig QUIET)
pkg_search_module(PKG_PIPEWIRE QUIET libpipewire-0.3)
@ -68,54 +59,42 @@ pkg_search_module(PKG_SPA QUIET libspa-0.2)
set(PIPEWIRE_DEFINITIONS "${PKG_PIPEWIRE_CFLAGS}" "${PKG_SPA_CFLAGS}")
set(PIPEWIRE_VERSION "${PKG_PIPEWIRE_VERSION}")
find_path(PIPEWIRE_INCLUDE_DIRS
NAMES
pipewire/pipewire.h
HINTS
${PKG_PIPEWIRE_INCLUDE_DIRS}
${PKG_PIPEWIRE_INCLUDE_DIRS}/pipewire-0.3
)
find_path(
PIPEWIRE_INCLUDE_DIRS
NAMES pipewire/pipewire.h
HINTS ${PKG_PIPEWIRE_INCLUDE_DIRS} ${PKG_PIPEWIRE_INCLUDE_DIRS}/pipewire-0.3)
find_path(SPA_INCLUDE_DIRS
NAMES
spa/param/props.h
HINTS
${PKG_SPA_INCLUDE_DIRS}
${PKG_SPA_INCLUDE_DIRS}/spa-0.2
)
find_path(
SPA_INCLUDE_DIRS
NAMES spa/param/props.h
HINTS ${PKG_SPA_INCLUDE_DIRS} ${PKG_SPA_INCLUDE_DIRS}/spa-0.2)
find_library(PIPEWIRE_LIBRARIES
NAMES
pipewire-0.3
HINTS
${PKG_PIPEWIRE_LIBRARY_DIRS}
)
find_library(
PIPEWIRE_LIBRARIES
NAMES pipewire-0.3
HINTS ${PKG_PIPEWIRE_LIBRARY_DIRS})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PipeWire
FOUND_VAR
PIPEWIRE_FOUND
REQUIRED_VARS
PIPEWIRE_LIBRARIES
PIPEWIRE_INCLUDE_DIRS
SPA_INCLUDE_DIRS
VERSION_VAR
PIPEWIRE_VERSION
)
find_package_handle_standard_args(
PipeWire
FOUND_VAR PIPEWIRE_FOUND
REQUIRED_VARS PIPEWIRE_LIBRARIES PIPEWIRE_INCLUDE_DIRS SPA_INCLUDE_DIRS
VERSION_VAR PIPEWIRE_VERSION)
if(PIPEWIRE_FOUND AND NOT TARGET PipeWire::PipeWire)
add_library(PipeWire::PipeWire UNKNOWN IMPORTED)
set_target_properties(PipeWire::PipeWire PROPERTIES
IMPORTED_LOCATION "${PIPEWIRE_LIBRARIES}"
INTERFACE_COMPILE_OPTIONS "${PIPEWIRE_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${PIPEWIRE_INCLUDE_DIRS};${SPA_INCLUDE_DIRS}"
)
add_library(PipeWire::PipeWire UNKNOWN IMPORTED)
set_target_properties(
PipeWire::PipeWire
PROPERTIES IMPORTED_LOCATION "${PIPEWIRE_LIBRARIES}"
INTERFACE_COMPILE_OPTIONS "${PIPEWIRE_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES
"${PIPEWIRE_INCLUDE_DIRS};${SPA_INCLUDE_DIRS}")
endif()
mark_as_advanced(PIPEWIRE_LIBRARIES PIPEWIRE_INCLUDE_DIRS)
include(FeatureSummary)
set_package_properties(PipeWire PROPERTIES
URL "https://www.pipewire.org"
DESCRIPTION "PipeWire - multimedia processing"
)
set_package_properties(
PipeWire PROPERTIES
URL "https://www.pipewire.org"
DESCRIPTION "PipeWire - multimedia processing")

View File

@ -1,68 +0,0 @@
# Once done these will be defined:
#
# PYTHON_FOUND
# PYTHON_INCLUDE_DIRS
# PYTHON_LIBRARIES
#
# For use in OBS:
#
# PYTHON_INCLUDE_DIR
if(NOT WIN32)
set(Python_ADDITIONAL_VERSIONS 3.4)
find_package(PythonLibs QUIET 3.4)
return()
endif()
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(_LIB_SUFFIX 64)
ELSE()
SET(_LIB_SUFFIX 32)
ENDIF()
FIND_PATH(PYTHON_INCLUDE_DIR
NAMES Python.h
HINTS
ENV PythonPath${_LIB_SUFFIX}
ENV PythonPath
ENV DepsPath${_LIB_SUFFIX}
ENV DepsPath
${PythonPath${_LIB_SUFFIX}}
${PythonPath}
${DepsPath${_LIB_SUFFIX}}
${DepsPath}
${_PYTHON_INCLUDE_DIRS}
PATH_SUFFIXES
include
include/python
)
find_library(PYTHON_LIB
NAMES ${_PYTHON_LIBRARIES} python36
HINTS
ENV PythonPath${_lib_suffix}
ENV PythonPath
ENV DepsPath${_lib_suffix}
ENV DepsPath
${PythonPath${_lib_suffix}}
${PythonPath}
${DepsPath${_lib_suffix}}
${DepsPath}
${_PYTHON_LIBRARY_DIRS}
PATH_SUFFIXES
lib${_lib_suffix} lib
libs${_lib_suffix} libs
bin${_lib_suffix} bin
../lib${_lib_suffix} ../lib
../libs${_lib_suffix} ../libs
../bin${_lib_suffix} ../bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Python DEFAULT_MSG PYTHON_LIB PYTHON_INCLUDE_DIR)
mark_as_advanced(PYTHON_INCLUDE_DIR PYTHON_LIB)
if(PYTHON_FOUND)
set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
set(PYTHON_LIBRARIES ${PYTHON_LIB})
set(PYTHONLIBS_FOUND TRUE)
endif()

Some files were not shown because too many files have changed in this diff Show More