#!/bin/zsh
pushd $SOURCE_PATH

git clone --depth 1 --branch "V7_7_2" "https://github.com/Open-Cascade-SAS/OCCT.git"
pushd OCCT
 cmake .  -L -B cmbuild \
	-DCMAKE_INSTALL_PREFIX="$INSTALLATION_PATH" \
  -DBUILD_DOC_Overview:BOOL=OFF \
  -DBUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=OFF \
  -DBUILD_Inspector:BOOL=OFF \
  -DBUILD_LIBRARY_TYPE:STRING=Shared \
  -DBUILD_MODULE_ApplicationFramework:BOOL=OFF \
  -DBUILD_MODULE_DETools:BOOL=OFF \
  -DBUILD_MODULE_DataExchange:BOOL=ON \
  -DBUILD_MODULE_Draw:BOOL=OFF \
  -DBUILD_MODULE_FoundationClasses:BOOL=TRUE \
  -DBUILD_MODULE_ModelingAlgorithms:BOOL=TRUE \
  -DBUILD_MODULE_ModelingData:BOOL=OFF \
  -DBUILD_MODULE_Visualization:BOOL=OFF \
  -DBUILD_OPT_PROFILE:STRING=Default \
  -DBUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=OFF \
  -DBUILD_RESOURCES:BOOL=OFF \
  -DBUILD_SAMPLES_QT:BOOL=OFF \
  -DBUILD_USE_PCH:BOOL=OFF \
  -DUSE_DRACO:BOOL=OFF \
  -DUSE_FFMPEG:BOOL=OFF \
  -DUSE_FREEIMAGE:BOOL=OFF \
  -DUSE_FREETYPE:BOOL=OFF \
  -DUSE_GLES2:BOOL=OFF \
  -DUSE_OPENGL:BOOL=OFF \
  -DUSE_OPENVR:BOOL=OFF \
  -DUSE_RAPIDJSON:BOOL=OFF \
  -DUSE_TBB:BOOL=OFF \
  -DUSE_TK:BOOL=OFF \
  -DUSE_VTK:BOOL=OFF \
  -DUSE_XLIB:BOOL=OFF \
	-DCMAKE_OSX_ARCHITECTURES="x86_64" \
	-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15

pushd cmbuild
make install -j $(sysctl -n hw.ncpu)
popd
popd
rm -rf OCCT
popd
