diff --git a/BUILDING.md b/BUILDING.md index c75c2bc9..4f54b586 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -25,6 +25,9 @@ sudo make install ``` ## OS X +As a prerequisite, you will need Xcode for your current OSX version, the command line tools, and [Homebrew](https://brew.sh/). +Homebrew's setup will guide you in getting your system set up, you should be good to go once Homebrew is successfully up and running. + Use of the Travis macOS CI scripts is recommended. Please note that these scripts install new software and can change several settings on your system. An existing obs-studio development environment is not required, as @@ -34,6 +37,7 @@ skip that script. Of course, you're encouraged to dig through the contents of these scripts to look for issues or specificities. + ``` git clone --recursive https://github.com/Palakis/obs-websocket.git cd obs-websocket diff --git a/CI/build-macos.sh b/CI/build-macos.sh index 561789cf..8419995d 100755 --- a/CI/build-macos.sh +++ b/CI/build-macos.sh @@ -3,7 +3,7 @@ set -ex #export QT_PREFIX="$(find /usr/local/Cellar/qt5 -d 1 | tail -n 1)" -mkdir build && cd build +mkdir -p build && cd build cmake .. \ -DQTDIR=/usr/local/opt/qt \ -DLIBOBS_INCLUDE_DIR=../../obs-studio/libobs \ diff --git a/CI/package-macos.sh b/CI/package-macos.sh index 69b131bb..7b09a237 100755 --- a/CI/package-macos.sh +++ b/CI/package-macos.sh @@ -3,7 +3,7 @@ set -e echo "-- Preparing package build" -export QT_CELLAR_PREFIX="$(find /usr/local/Cellar/qt -d 1 | tail -n 1)" +export QT_CELLAR_PREFIX="$(find /usr/local/Cellar/qt -d 1 | sort -t '.' -k 1,1n -k 2,2n -k 3,3n | tail -n 1)" export WS_LIB="/usr/local/opt/qt/lib/QtWebSockets.framework/QtWebSockets" export NET_LIB="/usr/local/opt/qt/lib/QtNetwork.framework/QtNetwork" @@ -21,19 +21,21 @@ export FILENAME="obs-websocket-$VERSION.pkg" export LATEST_FILENAME="obs-websocket-latest-$LATEST_VERSION.pkg" echo "-- Copying Qt dependencies" -cp $WS_LIB ./build -cp $NET_LIB ./build +if [ ! -f ./build/$(basename $WS_LIB) ]; then cp $WS_LIB ./build; fi +if [ ! -f ./build/$(basename $NET_LIB) ]; then cp $NET_LIB ./build; fi chmod +rw ./build/QtWebSockets ./build/QtNetwork echo "-- Modifying QtNetwork" install_name_tool \ + -id @rpath/QtNetwork \ -change /usr/local/opt/qt/lib/QtNetwork.framework/Versions/5/QtNetwork @rpath/QtNetwork \ -change $QT_CELLAR_PREFIX/lib/QtCore.framework/Versions/5/QtCore @rpath/QtCore \ ./build/QtNetwork echo "-- Modifying QtWebSockets" install_name_tool \ + -id @rpath/QtWebSockets \ -change /usr/local/opt/qt/lib/QtWebSockets.framework/Versions/5/QtWebSockets @rpath/QtWebSockets \ -change $QT_CELLAR_PREFIX/lib/QtNetwork.framework/Versions/5/QtNetwork @rpath/QtNetwork \ -change $QT_CELLAR_PREFIX/lib/QtCore.framework/Versions/5/QtCore @rpath/QtCore \ diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ce59665..6c464393 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,6 +200,7 @@ endif() if(APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -fvisibility=default") + set(CMAKE_SKIP_RPATH TRUE) set_target_properties(obs-websocket PROPERTIES PREFIX "") target_link_libraries(obs-websocket "${OBS_FRONTEND_LIB}") endif()