Skip to content

Commit 852661e

Browse files
committed
README + add options
* add detail about the APPLE_TEAM_ID env variable * add --arch, --help, and -c options
1 parent 32173e9 commit 852661e

File tree

4 files changed

+37
-9
lines changed

4 files changed

+37
-9
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "$ENV{APPLE_TEAM_ID}")
4242
# Run shell script to install the mac-camera-extension
4343
add_custom_target(run_script ALL
4444
COMMAND ${CMAKE_COMMAND} -E echo "Running the shell script..."
45-
COMMAND bash "./install-mac-camera-ext.sh" "${CAMERA_EXTENSION_GIT_TAG_VER}"
45+
COMMAND bash "./install-mac-camera-ext.sh" "${CAMERA_EXTENSION_GIT_TAG_VER}" "${CMAKE_OSX_ARCHITECTURES}"
4646
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
4747
COMMENT "Executing script.sh from CMake"
4848
)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ CMake (minimum 3.22) and xcode 15.2
88

99
# How to Build
1010

11-
Run the following commands:
11+
Make sure you define the `APPLE_TEAM_ID` environment variable which is required because the build scripts will download the slobs-mac-virtual camera system extension and codesign it.
12+
Run the following commands below (or just run `build.sh` script):
1213

1314
```
1415
cmake --preset macos

build.sh

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
1-
# Usage: ./build.sh <clean>
2-
cd "$(dirname "$0")"
1+
# Usage: ./build.sh [--clean | --arch=<arch>]
2+
function display_usage {
3+
echo "Usage: $(basename "$0") [OPTIONS]"
4+
echo ""
5+
echo "Description: This script builds the Streamlabs Mac Virtual Camera installer app."
6+
echo ""
7+
echo "Options:"
8+
echo " -h, --help Display this help message and exit."
9+
echo " --arch sets CMAKE_OSX_ARCHITECTURES For example- arm64 or x86_64"
10+
echo " --clean,-c cleans cmake cache"
11+
echo ""
12+
echo "Examples:"
13+
echo " $(basename "$0") --arch=x86_64"
14+
exit 0
15+
}
316

4-
if [[ "$1" == "clean" ]]; then
5-
# Wipe cmake cache
6-
rm -rf build
17+
if [[ ( "$1" == "--help" ) || ( "$1" == "-h" ) ]]; then
18+
display_usage
719
fi
820

9-
cmake --preset macos
21+
cd "$(dirname "$0")"
22+
cmake_args=()
23+
24+
for arg in "$@"
25+
do
26+
if [[ ("$arg" == "--clean") || ("$arg" == "-c") ]]; then
27+
# Wipe cmake cache
28+
rm -rf build
29+
elif [[ $arg == --arch=* ]]; then
30+
# Extract the value using parameter expansion
31+
arch_value="${arg#*=}"
32+
cmake_args+=(-DCMAKE_OSX_ARCHITECTURES=${arch_value})
33+
fi
34+
done
35+
36+
cmake --preset macos "${cmake_args[@]}"
1037
cmake --build build --preset macos

install-mac-camera-ext.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cd obs-studio/plugins/mac-virtualcam/src/camera-extension
1010
checkArch=$(arch)
1111
echo "Build the mac-camera-extension on $checkArch"
1212

13-
./build-slobs-cameraextension.sh
13+
./build-slobs-cameraextension.sh "$2"
1414

1515
echo "Copy system extension into the app bundle at Contents/Library/SystemExtensions folder"
1616
cd "$root"

0 commit comments

Comments
 (0)