Commit 5c43c4ba by Christophe Geuzaine

Merge branch 'androidWithOCC' into 'master'

Android with occ

See merge request !10
parents 6ce0ac5e 92d93b03
Pipeline #158 passed with stage
in 8 minutes 52 seconds
......@@ -1478,6 +1478,8 @@ if(ENABLE_BUILD_ANDROID)
add_library(androidGmsh SHARED ${GMSH_SRC})
set_target_properties(androidGmsh PROPERTIES OUTPUT_NAME Gmsh)
target_link_libraries(androidGmsh ${EXTERNAL_LIBRARIES} ${LAPACK_LIBRARIES})
add_custom_command(TARGET androidGmsh POST_BUILD COMMAND
${CMAKE_STRIP} ${LIBRARY_OUTPUT_PATH}/libGmsh.so)
endif(ENABLE_BUILD_ANDROID)
# shared library target
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.geuz.onelab"
android:versionName="1.7.0"
android:versionCode="30"
android:versionName="2.0.0"
android:versionCode="31"
android:installLocation="auto" >
<uses-sdk android:minSdkVersion="14"
......
......@@ -19,6 +19,8 @@ fi
petsc_lib="$frameworks_dir/petsc"
slepc_lib="$frameworks_dir/slepc"
occ_lib="$frameworks_dir/occt/lib"
occ_inc="$frameworks_dir/occt/inc"
android_ndk="${HOME}/Library/Android/sdk/ndk-bundle/"
android_sdk="${HOME}/Library/Android/sdk/"
......@@ -40,7 +42,7 @@ if [ ! -d "$gmsh_git/build_android" ] || [ ! -f "$gmsh_git/build_android/CMakeCa
mkdir $gmsh_git/build_android
fi
cd $gmsh_git/build_android
cmake $cmake_default -DENABLE_BLAS_LAPACK=1 -DENABLE_BUILD_SHARED=1 -DENABLE_MATHEX=1 -DENABLE_MESH=1 -DENABLE_ONELAB=1 -DENABLE_PARSER=1 -DENABLE_POST=1 -DENABLE_PLUGINS=1 -DENABLE_ANN=1 -DENABLE_TETGEN=1 -DENABLE_KBIPACK=1 -DENABLE_GMP=0 -DENABLE_ZIPPER=1 -DBLAS_LAPACK_LIBRARIES="$petsc_lib/libf2cblas.so;$petsc_lib/libf2clapack.so" ..
cmake $cmake_default -DENABLE_BLAS_LAPACK=1 -DENABLE_BUILD_SHARED=1 -DENABLE_MATHEX=1 -DENABLE_MESH=1 -DENABLE_ONELAB=1 -DENABLE_PARSER=1 -DENABLE_POST=1 -DENABLE_PLUGINS=1 -DENABLE_ANN=1 -DENABLE_TETGEN=1 -DENABLE_KBIPACK=1 -DENABLE_GMP=0 -DENABLE_ZIPPER=1 -DBLAS_LAPACK_LIBRARIES="$petsc_lib/libf2cblas.so;$petsc_lib/libf2clapack.so" -DENABLE_OCC=1 -DOCC_LIBS="${occ_lib}/libTKSTEP.a;${occ_lib}/libTKSTEP209.a;${occ_lib}/libTKSTEPAttr.a;${occ_lib}/libTKSTEPBase.a;${occ_lib}/libTKIGES.a;${occ_lib}/libTKXSBase.a;${occ_lib}/libTKOffset.a;${occ_lib}/libTKFeat.a;${occ_lib}/libTKFillet.a;${occ_lib}/libTKBool.a;${occ_lib}/libTKShHealing.a;${occ_lib}/libTKMesh.a;${occ_lib}/libTKHLR.a;${occ_lib}/libTKBO.a;${occ_lib}/libTKPrim.a;${occ_lib}/libTKTopAlgo.a;${occ_lib}/libTKGeomAlgo.a;${occ_lib}/libTKBRep.a;${occ_lib}/libTKGeomBase.a;${occ_lib}/libTKG3d.a;${occ_lib}/libTKG2d.a;${occ_lib}/libTKMath.a;${occ_lib}/libTKernel.a" -DOCC_INC=${occ_inc} ..
check
make androidGmsh -j$cmake_thread
check
......
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: $0 file1.geo file2.geo ..." 1>&2;
exit 1;
fi
files=$*
rm -rf Archive
mkdir Archive
cp *.step Archive/
cat <<EOT >> Archive/infos.xml
<?xml version="1.0" encoding="utf-8"?>
<models>
EOT
for file in $files ; do
cp $file Archive/
echo "<model>" >> Archive/infos.xml
echo "<title>$file</title>" >> Archive/infos.xml
echo "<summary>$file</summary>" >> Archive/infos.xml
echo "<file type=\"geo\">$file</file>" >> Archive/infos.xml
echo "</model>" >> Archive/infos.xml
cat <<EOT > Archive/${file%.geo}.pro
DefineConstant[
R_ = {"", Name "GetDP/1ResolutionChoices", Visible 0},
C_ = {"", Name "GetDP/9ComputeCommand", Visible 0},
P_ = {"", Name "GetDP/2PostOperationChoices", Visible 0}
];
EOT
done
cat <<EOT >> Archive/infos.xml
</models>
EOT
zip -r Archive.zip Archive
####### 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment