Open CASCADE Technology  6.8.0

Building with CMake and ADT for Android

This file describes the steps to build OCCT libraries from a complete source package with following tools:

Generation of eclipse project files

Run GUI tool provided by CMake: cmake-gui

Tools configuration

  • Specify the root folder of OCCT ($CASROOT, which contains CMakelists.txt file) by clicking Browse Source.
  • Specify the location (build folder) for Cmake generated project files by clicking Browse Build.
android_image001.png

Click Configure button. It opens the window with a drop-down list of generators supported by CMake project. -

Select "Eclipse CDT4 - MinGW MakeFiles" item from the list

  • Choose "Specify toolchain file for cross-compiling"
  • Click "Next"
    android_image002.png
  • Specify the Toolchain file at next dialog by android.toolchain.cmake is contained by cross-compilation toolchain for CMake
  • Click "Finish"
    android_image003.png

Add cache entry ANDROID_NDK - path (entry type is PATH) to the NDK folder ("Add Entry" button)

android_image004.png

if there is message "CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool." Define CMAKE_MAKE_PROGRAM variable with the file path to mingw32-make executable.

android_image005.png

OCCT Configuration

How to configure OCCT, see "OCCT Configuration" section of Building with CMake taking into account the specific configuration variables for android:

  • ANDROID_ABI = armeabi-v7a
  • ANDROID_NATIVE_API_LEVEL = 15
  • ANDROID_NDK_LAYOUT is equal to BUILD_CONFIGURATION variable
  • CMAKE_ECLIPSE_VERSION is equal to installed eclipse version (e.g., 4.2)

Configure parallel building:

  • CMAKE_ECLIPSE_MAKE_ARGUMENTS = -jN where N = your numbers of CPU cores (threads)
android_image006.png

Generation of eclipse projects files

Click Generate button and wait until the generation process is finished. Then the eclipse project files will appear in the build folder (e.g. D:/android-build-eclipse-api-15 ).

Building eclipse project files of OCCT

  • Open eclipse (downloaded ADT bundle contains it)
    android_image007.png
  • Import "Existing project into Workspace"
    android_image008.png
android_image009.png
  • Build ALL
    android_image010.png

When the building process has finished, libraries are located in <build folder>/out (e.g. D:/android-build-eclipse-api-15/out ).