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

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

xcodebuild -configuration Release OTHER_CFLAGS="-target arm64-apple-ios9.0 -fembed-bitcode" OTHER_CPLUSPLUSFLAGS="-target arm64-apple-ios9.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="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="-target arm64-apple-ios9.0 -fembed-bitcode" OTHER_CPLUSPLUSFLAGS="-target arm64-apple-ios9.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 -DANDROID_ABI=arm64-v8a ..

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