0031619: Samples - update JNI sample to use Android Studio
[occt.git] / samples / java / jniviewer / app / src / main / jni / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.4.1)
2
3 set(HEADER_FILES OcctJni_MsgPrinter.hxx OcctJni_Viewer.hxx)
4 set(SOURCE_FILES OcctJni_MsgPrinter.cxx OcctJni_Viewer.cxx)
5
6 set (anOcctLibs
7   TKernel TKMath TKG2d TKG3d TKGeomBase TKBRep TKGeomAlgo TKTopAlgo TKShHealing TKMesh
8   # exchange
9   TKPrim TKBO TKBool TKFillet TKOffset
10   TKXSBase
11   TKIGES
12   TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP
13   # OCCT Visualization
14   TKService TKHLR TKV3d TKOpenGl
15 )
16
17 set(aLibDeps "")
18
19 # OCCT libraries
20 include_directories(${OCCT_ROOT}/inc)
21 foreach(anOcctLib ${anOcctLibs})
22   add_library(lib_${anOcctLib} SHARED IMPORTED)
23   set_target_properties(lib_${anOcctLib} PROPERTIES IMPORTED_LOCATION ${OCCT_ROOT}/libs/${ANDROID_ABI}/lib${anOcctLib}.so)
24   list(APPEND aLibDeps lib_${anOcctLib})
25 endforeach()
26
27 # FreeType
28 add_library(lib_FreeType SHARED IMPORTED)
29 set_target_properties(lib_FreeType PROPERTIES IMPORTED_LOCATION ${FREETYPE_ROOT}/libs/${ANDROID_ABI}/libfreetype.so)
30 list(APPEND aLibDeps lib_FreeType)
31
32 # FreeImage - uncomment, if OCCT was built with FreeImage
33 #add_library(lib_FreeImage SHARED IMPORTED)
34 #set_target_properties(lib_FreeImage PROPERTIES IMPORTED_LOCATION ${FREETYPE_ROOT}/libs/${ANDROID_ABI}/libfreeimage.so)
35 #list(APPEND aLibDeps lib_FreeImage)
36
37 # system libraries
38 list(APPEND aLibDeps EGL GLESv2 log android)
39
40 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -frtti -fexceptions -fpermissive")
41
42 add_library(TKJniSample SHARED ${SOURCE_FILES})
43 target_link_libraries(TKJniSample ${aLibDeps})