Archived issue #0028135
Configuration - adopt building script for using built-in Android cross-compiling support in CMake 3.7
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
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
• 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.
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
[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
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.
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.
I have checked compilation of occt for Android platform using this patch on CMake 3.7.0 and 3.7.1.
Documentation was updated.
Documentation was updated.
Dear ibs,
please review.
please review.
+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.
Remark from abv,
in OCCT 7.1.0 release notes:
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.
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.
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.
[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.
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.
[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.
Done.
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)?
But is there some information concerning which C++ standard library / STL implementation is used (gnustl_static / gnustl_shared / stlport_static / stlport_shared)?
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)
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)
> The default value is gnustl_static.
Please set this variable to "gnustl_shared" and provide description in our documentation.
Please set this variable to "gnustl_shared" and provide description in our documentation.
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.
[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.
Done.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
dear bugmastre,
there are no remarks, please integrate
there are no remarks, please integrate
I suppose that weekly Android builds should be now based on this procedure.
Branch [archived branch] has been deleted by Author.
[revision removed]
[revision removed]
Related records