build-macos.sh 769 B

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. OSTYPE=$(uname)
  3. if [ "${OSTYPE}" != "Darwin" ]; then
  4. echo "[Error] macOS build script can be run on Darwin-type OS only."
  5. exit 1
  6. fi
  7. HAS_CMAKE=$(type cmake 2>/dev/null)
  8. if [ "${HAS_CMAKE}" = "" ]; then
  9. echo "[Error] CMake not installed - please run 'install-dependencies-macos.sh' first."
  10. exit 1
  11. fi
  12. #export QT_PREFIX="$(find /usr/local/Cellar/qt5 -d 1 | tail -n 1)"
  13. echo "=> Building plugin for macOS."
  14. mkdir -p build && cd build
  15. cmake .. \
  16. -DQTDIR=/usr/local/opt/qt \
  17. -DLIBOBS_INCLUDE_DIR=../../obs-studio/libobs \
  18. -DLIBOBS_LIB=../../obs-studio/libobs \
  19. -DOBS_FRONTEND_LIB="$(pwd)/../../obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" \
  20. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  21. -DCMAKE_INSTALL_PREFIX=/usr \
  22. && make -j4