####### configuration for OCCT 7.1 #######

################# iOS: ####
cmake -DCMAKE_TOOLCHAIN_FILE=~/src/gmsh/contrib/mobile/utils/iOS.cmake -DAppkit_LIB="" -DOpenGlLibs_LIB="" -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="armv7;armv7s;arm64" -DCMAKE_SIZEOF_VOID_P=8 -GXcode -DBUILD_MODULE_Draw=0 -DBUILD_MODULE_Visualization=0 -DBUILD_LIBRARY_TYPE=Static ..

xcodebuild -configuration Release OTHER_CFLAGS="-miphoneos-version-min=8.0 -fembed-bitcode" OTHER_CPLUSPLUSFLAGS="-miphoneos-version-min=8.0 -fembed-bitcode -std=c++11"

# Then combine all static libs using merge_static_libs.sh and put it in OCCT.framework

################## iOS Simulator: ####
cmake -DCMAKE_TOOLCHAIN_FILE=~/src/gmsh/contrib/mobile/utils/iOS.cmake -DAppkit_LIB="" -DOpenGlLibs_LIB="" -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" -DIOS_PLATFORM=SIMULATOR -DCMAKE_SIZEOF_VOID_P=8 -GXcode -DBUILD_MODULE_Draw=0 -DBUILD_MODULE_Visualization=0 -DBUILD_LIBRARY_TYPE=Static ..

xcodebuild -configuration Release OTHER_CFLAGS="-miphoneos-version-min=8.0 -fembed-bitcode" OTHER_CPLUSPLUSFLAGS="-miphoneos-version-min=8.0 -fembed-bitcode -std=c++11"

# Then combine all static libs using merge_static_libs.sh and put it in OCCT.framework

################## Android ####
cmake -DCMAKE_TOOLCHAIN_FILE=~/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MODULE_Draw=0 -DBUILD_MODULE_Visualization=0 -DBUILD_MODULE_ApplicationFramework=0 -DBUILD_LIBRARY_TYPE=Static -DCMAKE_PREFIX_PATH=/opt/local ..

make -j 8 -k  ### -k so that compilation will continue even when linking to freetype fails

