#!/bin/bash set -e IMATH_VERSION=3.1.3 UE_MODULE_LOCATION=`pwd` SOURCE_LOCATION="$UE_MODULE_LOCATION/Imath-$IMATH_VERSION" BUILD_LOCATION="$UE_MODULE_LOCATION/Intermediate" # Specify all of the include/bin/lib directory variables so that CMake can # compute relative paths correctly for the imported targets. INSTALL_INCLUDEDIR=include INSTALL_BIN_DIR="Mac/bin" INSTALL_LIB_DIR="Mac/lib" INSTALL_LOCATION="$UE_MODULE_LOCATION/Deploy/Imath-$IMATH_VERSION" INSTALL_INCLUDE_LOCATION="$INSTALL_LOCATION/$INSTALL_INCLUDEDIR" INSTALL_MAC_LOCATION="$INSTALL_LOCATION/Mac" rm -rf $BUILD_LOCATION rm -rf $INSTALL_INCLUDE_LOCATION rm -rf $INSTALL_MAC_LOCATION mkdir $BUILD_LOCATION pushd $BUILD_LOCATION CMAKE_ARGS=( -DCMAKE_INSTALL_PREFIX="$INSTALL_LOCATION" -DCMAKE_INSTALL_INCLUDEDIR="$INSTALL_INCLUDEDIR" -DCMAKE_INSTALL_BINDIR="$INSTALL_BIN_DIR" -DCMAKE_INSTALL_LIBDIR="$INSTALL_LIB_DIR" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.9" -DBUILD_SHARED_LIBS=FALSE -DIMATH_INSTALL_PKG_CONFIG=FALSE -DBUILD_TESTING=OFF -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" ) echo Configuring build for Imath version $IMATH_VERSION... cmake -G "Xcode" $SOURCE_LOCATION "${CMAKE_ARGS[@]}" echo Building Imath for Debug... cmake --build . --config Debug echo Installing Imath for Debug... cmake --install . --config Debug echo Building Imath for Release... cmake --build . --config Release echo Installing Imath for Release... cmake --install . --config Release popd echo Done.