DiscussionsIssue archiveOCCT:Configuration

Archived issue #0028135

Configuration - adopt building script for using built-in Android cross-compiling support in CMake 3.7

Open CASCADEOCCT:Configurationclosed18 public notes

Search issues

Description

CMake 3.7 introduces built-in support for Android platform (in contrast to third-party toolchain for CMake). This procedure should be analyzed and OCCT CMake scripts / Readme should be updated if needed.

https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html#cross-compiling-for-android

Steps to reproduce

• Set variable CMAKE_ANDROID_NDK equal to yout Android NDK path in file occt\adm\templates\android.toolchain.config.cmake
• Run CMake 3.7.x as usual
• Press Configure -> Select "MinGW Makefiles" generator and use third checkbox (about toolchain file) -> Next
• Select file occt\adm\templates\android.toolchain.config.cmake
• Repeat all other steps as usual (set install/3rd-party directories, etc)
• Build and install solution

Public activity

18 archived notes

Participants are labeled by their role within this record.

01Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: ski
Date: Wed Dec 21 13:41:04 2016 +0300

    Eliminated CMake warning CMP0054 for Android platform build.

Author: ski
Date: Wed Dec 21 13:41:04 2016 +0300

    0028135: Configuration - adopt building script for using built-in Android cross-compiling support in CMake 3.7
    
    Added toolchain file for using built-in Android cross-compiling support in CMake 3.7
02Commenter 2
CMake warning CMP0054 appears because line 222 from file "occt/adm/cmake/occt_toolkit.cmake":

if (NOT "${CURRENT_CSF}" STREQUAL "")

in case of Android build, variable CSF_ThreadLibs contains "c" string.
Also, variable "c" is defined in CMake.
Because of these two factors warning CMP0054 appears.
03Commenter 3
I have checked compilation of occt for Android platform using this patch on CMake 3.7.0 and 3.7.1.

Documentation was updated.
04Commenter 4
Dear ibs,

please review.
05Author
+Note that CMake supports Cross Compiling for Android with simple toolchain files since version **3.7.0**.

The references to obsolete solution should be eliminated from documentation.

06Author
Remark from abv,

in OCCT 7.1.0 release notes:
On configuration step of CMake, select "Visual Studio 14 2015" as generator
and specify optional toolset, pointing to the file
adm/templates/uwp.toolchain.config.cmake located within OCCT sources.
Alternatively, run CMake with options -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.


Please extend the OCCT documentation with similar suggestion for UWP and Android which does not require using addition toolsets just defining 2-4 additional CMake variables.

07Commenter 3
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: ski
Date: Wed Dec 21 19:38:50 2016 +0300

    Updated documentation about building of occt for Android platform via CMake.

08Commenter 3
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: ski
Date: Wed Dec 21 19:50:07 2016 +0300

    Updated documentation about building of occt for UWP via CMake.

09Commenter 9
Done.
10Author
I see on the screenshot, that CMake chooses gcc as compiler in NDK (NDK provides two options - gcc and CLang, we prefer gcc for now).

But is there some information concerning which C++ standard library / STL implementation is used (gnustl_static / gnustl_shared / stlport_static / stlport_shared)?
11Commenter 11
It is possible to add one more variable to android toolchain file (or use it from command line):

CMAKE_ANDROID_STL_TYPE
    Set to specify which C++ standard library to use. If not specified, a default will be selected as described in the variable documentation.
(see https://cmake.org/cmake/help/v3.7/variable/CMAKE_ANDROID_STL_TYPE.html#variable:CMAKE_ANDROID_STL_TYPE)
12Author
> The default value is gnustl_static.
Please set this variable to "gnustl_shared" and provide description in our documentation.
13Commenter 3
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: ski
Date: Thu Dec 22 12:51:24 2016 +0300

    Added variable CMAKE_ANDROID_STL_TYPE for Android platform build via CMake.

14Commenter 14
Done.
15Commenter 3
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
16Commenter 16
dear bugmastre,
there are no remarks, please integrate
17Author
I suppose that weekly Android builds should be now based on this procedure.
18Commenter 3
Branch [archived branch] has been deleted by Author.

[revision removed]

Related records