You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
The build scripts included here are largely copies of the existing build scripts for Windows, so their usage is similar. The build products included here represent Blosc version 1.21.0 and OpenVDB 8.1.0, the same versions currently used on Windows. A subsequent change will update the module rules to put this new set of libraries into use with engine builds. #jira UE-153244 #rb none #preflight 628c1d8905113038b4af0d2c #fyi devon.penney [CL 20375476 by matt johnson in ue5-main branch]
110 lines
3.4 KiB
Bash
Executable File
110 lines
3.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
UsageAndExit()
|
|
{
|
|
echo "Build OpenVDB for use with Unreal Engine on Mac"
|
|
echo
|
|
echo "Usage:"
|
|
echo
|
|
echo " BuildForMac.command <OpenVDB Version>"
|
|
echo
|
|
echo "Usage examples:"
|
|
echo
|
|
echo " BuildForMac.command 8.1.0"
|
|
echo " -- Installs OpenVDB version 8.1.0."
|
|
exit 1
|
|
}
|
|
|
|
# Get version from arguments.
|
|
OPENVDB_VERSION=$1
|
|
if [ -z "$OPENVDB_VERSION" ]
|
|
then
|
|
UsageAndExit
|
|
fi
|
|
|
|
BUILD_SCRIPT_LOCATION=`cd $(dirname "$0"); pwd`
|
|
UE_THIRD_PARTY_LOCATION=`cd $BUILD_SCRIPT_LOCATION/../../..; pwd`
|
|
|
|
ZLIB_LOCATION="$UE_THIRD_PARTY_LOCATION/zlib/v1.2.8"
|
|
ZLIB_INCLUDE_LOCATION="$ZLIB_LOCATION/include/Mac"
|
|
ZLIB_LIB_LOCATION="$ZLIB_LOCATION/lib/Mac/libz.a"
|
|
|
|
TBB_LOCATION="$UE_THIRD_PARTY_LOCATION/Intel/TBB/IntelTBB-2019u8"
|
|
TBB_INCLUDE_LOCATION="$TBB_LOCATION/include"
|
|
TBB_LIB_LOCATION="$TBB_LOCATION/lib/Mac"
|
|
|
|
BLOSC_LOCATION="$UE_THIRD_PARTY_LOCATION/Blosc/Deploy/c-blosc-1.21.0"
|
|
BLOSC_INCLUDE_LOCATION="$BLOSC_LOCATION/include"
|
|
BLOSC_LIB_LOCATION="$BLOSC_LOCATION/Mac/lib"
|
|
BLOSC_LIBRARY_LOCATION_RELEASE="$BLOSC_LIB_LOCATION/libblosc.a"
|
|
BLOSC_LIBRARY_LOCATION_DEBUG="$BLOSC_LIB_LOCATION/libblosc_d.a"
|
|
|
|
BOOST_LOCATION="$UE_THIRD_PARTY_LOCATION/Boost/boost-1_70_0"
|
|
BOOST_INCLUDE_LOCATION="$BOOST_LOCATION/include"
|
|
BOOST_LIB_LOCATION="$BOOST_LOCATION/lib/Mac"
|
|
|
|
UE_MODULE_LOCATION=`cd $BUILD_SCRIPT_LOCATION/../..; pwd`
|
|
|
|
SOURCE_LOCATION="$UE_MODULE_LOCATION/openvdb-$OPENVDB_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/openvdb-$OPENVDB_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 > /dev/null
|
|
|
|
CMAKE_ARGS=(
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_LOCATION"
|
|
-DCMAKE_INSTALL_INCLUDEDIR="$INSTALL_INCLUDEDIR"
|
|
-DCMAKE_INSTALL_BINDIR="$INSTALL_BIN_DIR"
|
|
-DCMAKE_INSTALL_LIBDIR="$INSTALL_LIB_DIR"
|
|
-DZLIB_INCLUDE_DIR="$ZLIB_INCLUDE_LOCATION"
|
|
-DZLIB_LIBRARY="$ZLIB_LIB_LOCATION"
|
|
-DTBB_INCLUDEDIR="$TBB_INCLUDE_LOCATION"
|
|
-DTBB_LIBRARYDIR="$TBB_LIB_LOCATION"
|
|
-DBLOSC_INCLUDEDIR="$BLOSC_INCLUDE_LOCATION"
|
|
-DBLOSC_LIBRARYDIR="$BLOSC_LIB_LOCATION"
|
|
-DBLOSC_USE_STATIC_LIBS=ON
|
|
-DBlosc_LIBRARY_RELEASE="$BLOSC_LIBRARY_LOCATION_RELEASE"
|
|
-DBlosc_LIBRARY_DEBUG="$BLOSC_LIBRARY_LOCATION_DEBUG"
|
|
-DBoost_NO_BOOST_CMAKE=ON
|
|
-DBoost_NO_SYSTEM_PATHS=ON
|
|
-DBOOST_INCLUDEDIR="$BOOST_INCLUDE_LOCATION"
|
|
-DBOOST_LIBRARYDIR="$BOOST_LIB_LOCATION"
|
|
-DCMAKE_OSX_DEPLOYMENT_TARGET="10.9"
|
|
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
|
|
-DUSE_PKGCONFIG=OFF
|
|
-DOPENVDB_BUILD_BINARIES=OFF
|
|
-DOPENVDB_INSTALL_CMAKE_MODULES=OFF
|
|
-DOPENVDB_CORE_SHARED=OFF
|
|
-DOPENVDB_CORE_STATIC=ON
|
|
)
|
|
|
|
echo Configuring build for OpenVDB version $OPENVDB_VERSION...
|
|
cmake -G "Xcode" $SOURCE_LOCATION "${CMAKE_ARGS[@]}"
|
|
|
|
echo Building OpenVDB for Release...
|
|
cmake --build . --config Release -j8
|
|
|
|
echo Installing OpenVDB for Release...
|
|
cmake --install . --config Release
|
|
|
|
popd > /dev/null
|
|
|
|
echo Done.
|