Open CASCADE Technology
7.4.0
|
|
This article describes the steps to build OCCT libraries for Android from a complete source package with GNU make (makefiles) on Windows 7 and Ubuntu 15.10.
The steps on Windows and Ubuntu are similar. There is the only one difference: makefiles are built with mingw32-make on Windows and native GNU make on Ubuntu.
Required tools (download and install if it is required):
In toolchain file $CASROOT/adm/templates/android.toolchain.config.cmake:
The default value of CMAKE_ANDROID_STL_TYPE is gnustl_shared (GNU libstdc++ Shared)
Run GUI tool provided by CMake: cmake-gui
Click Configure button. It opens the window with a drop-down list of generators supported by CMake project.
Select "MinGW Makefiles" item from the list
If on Windows the message is appeared: "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.", specify CMAKE_MAKE_PROGRAM to mingw32-make executable.
How to configure OCCT, see "OCCT Configuration" section of Building with CMake
Click Generate button and wait until the generation process is finished. Then makefiles will appear in the build folder (e.g. D:/occt/build-android ).
Alternatively one may specify the values without a toolchain file:
cmake -G "MinGW Makefiles" -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=D:/DevTools/android-ndk-r13b -DCMAKE_ANDROID_STL_TYPE=gnustl_shared -DCMAKE_SYSTEM_VERSION=15 -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_MAKE_PROGRAM=D:/DevTools/MinGW/bin/mingw32-make.exe -D3RDPARTY_DIR=D:/occt-3rdparty D:/occt
Open console and go to the build folder. Type "mingw32-make" (Windows) or "make" (Ubuntu) to start build process.
mingw32-make
or
make
Parallel building can be started with using **"-jN"** argument of "mingw32-make/make", where N is the number of building threads.
mingw32-make -j4
or
make -j4
Type "mingw32-make/make" with argument "install" to place the libraries to the install folder (see "OCCT Configuration" section of Building with CMake)
mingw32-make install
or
make install