0031619: Samples - update JNI sample to use Android Studio
[occt.git] / samples / java / jniviewer / jni / Android.mk
1 LOCAL_PATH:= $(call my-dir)
2
3 STL_INC := $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/$(TARGET_ARCH_ABI)/include
4 #STL_LIB := $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/$(TARGET_ARCH_ABI)/libgnustl_static.a
5 STL_LIB := $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/$(TARGET_ARCH_ABI)/libgnustl_shared.so
6
7 OCCT_ROOT := $(LOCAL_PATH)/../../../..
8
9 FREETYPE_INC  := $(OCCT_ROOT)/../freetype/include/freetype2
10 FREETYPE_LIBS := $(OCCT_ROOT)/../freetype/libs
11
12 FREEIMAGE_INC  := $(OCCT_ROOT)/../FreeImage/include
13 FREEIMAGE_LIBS := $(OCCT_ROOT)/../FreeImage/libs
14
15 OCCT_INC  := $(OCCT_ROOT)/inc
16 OCCT_LIBS := $(OCCT_ROOT)/and/libs
17
18 ASSETDIR := $(LOCAL_PATH)/../assets
19
20 $(ASSETDIR)/Shaders: $(ASSETDIR)
21         -mkdir -p $(ASSETDIR)
22         -mkdir -p $(ASSETDIR)/Shaders
23         cp -f -r $(OCCT_ROOT)/src/Shaders/*.* $(ASSETDIR)/Shaders
24
25 $(ASSETDIR)/SHMessage: $(ASSETDIR)
26         -mkdir -p $(ASSETDIR)
27         -mkdir -p $(ASSETDIR)/SHMessage
28         cp -f -r $(OCCT_ROOT)/src/SHMessage/*.* $(ASSETDIR)/SHMessage
29
30 $(ASSETDIR)/XSMessage: $(ASSETDIR)
31         -mkdir -p $(ASSETDIR)
32         -mkdir -p $(ASSETDIR)/XSMessage
33         cp -f -r $(OCCT_ROOT)/src/XSMessage/*.* $(ASSETDIR)/XSMessage
34
35 pre_all: $(ASSETDIR)/Shaders $(ASSETDIR)/SHMessage $(ASSETDIR)/XSMessage
36
37 jniall: pre_all all
38
39 # STL libs
40 include $(CLEAR_VARS)
41 LOCAL_MODULE := SharedStl
42 LOCAL_EXPORT_C_INCLUDES := $(STL_INC)
43 LOCAL_SRC_FILES := $(STL_LIB)
44 include $(PREBUILT_SHARED_LIBRARY)
45
46 # 3rd-parties used in OCCT
47 include $(CLEAR_VARS)
48 LOCAL_MODULE := FreeType
49 LOCAL_EXPORT_C_INCLUDES := $(FREETYPE_INC)
50 LOCAL_SRC_FILES := $(FREETYPE_LIBS)/$(TARGET_ARCH_ABI)/libfreetype.so
51 include $(PREBUILT_SHARED_LIBRARY)
52
53 #include $(CLEAR_VARS)
54 #LOCAL_MODULE := FreeImage
55 #LOCAL_EXPORT_C_INCLUDES := $(FREEIMAGE_INC)
56 #LOCAL_SRC_FILES := $(FREEIMAGE_LIBS)/$(TARGET_ARCH_ABI)/libfreeimage.so
57 #include $(PREBUILT_SHARED_LIBRARY)
58
59 # OCCT core
60 include $(CLEAR_VARS)
61 LOCAL_MODULE := OcctTKernel
62 LOCAL_EXPORT_C_INCLUDES := $(OCCT_INC)
63 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKernel.so
64 include $(PREBUILT_SHARED_LIBRARY)
65
66 include $(CLEAR_VARS)
67 LOCAL_MODULE := OcctTKMath
68 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKMath.so
69 include $(PREBUILT_SHARED_LIBRARY)
70
71 include $(CLEAR_VARS)
72 LOCAL_MODULE := OcctTKG2d
73 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKG2d.so
74 include $(PREBUILT_SHARED_LIBRARY)
75
76 include $(CLEAR_VARS)
77 LOCAL_MODULE := OcctTKG3d
78 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKG3d.so
79 include $(PREBUILT_SHARED_LIBRARY)
80
81 include $(CLEAR_VARS)
82 LOCAL_MODULE := OcctTKGeomBase
83 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKGeomBase.so
84 include $(PREBUILT_SHARED_LIBRARY)
85
86 include $(CLEAR_VARS)
87 LOCAL_MODULE := OcctTKBRep
88 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKBRep.so
89 include $(PREBUILT_SHARED_LIBRARY)
90
91 include $(CLEAR_VARS)
92 LOCAL_MODULE := OcctTKGeomAlgo
93 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKGeomAlgo.so
94 include $(PREBUILT_SHARED_LIBRARY)
95
96 include $(CLEAR_VARS)
97 LOCAL_MODULE := OcctTKTopAlgo
98 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKTopAlgo.so
99 include $(PREBUILT_SHARED_LIBRARY)
100
101 include $(CLEAR_VARS)
102 LOCAL_MODULE := OcctTKShHealing
103 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKShHealing.so
104 include $(PREBUILT_SHARED_LIBRARY)
105
106 include $(CLEAR_VARS)
107 LOCAL_MODULE := OcctTKMesh
108 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKMesh.so
109 include $(PREBUILT_SHARED_LIBRARY)
110
111 # OCCT Exchange
112 include $(CLEAR_VARS)
113 LOCAL_MODULE := OcctTKPrim
114 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKPrim.so
115 include $(PREBUILT_SHARED_LIBRARY)
116
117 include $(CLEAR_VARS)
118 LOCAL_MODULE := OcctTKBO
119 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKBO.so
120 include $(PREBUILT_SHARED_LIBRARY)
121
122 include $(CLEAR_VARS)
123 LOCAL_MODULE := OcctTKBool
124 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKBool.so
125 include $(PREBUILT_SHARED_LIBRARY)
126
127 include $(CLEAR_VARS)
128 LOCAL_MODULE := OcctTKFillet
129 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKFillet.so
130 include $(PREBUILT_SHARED_LIBRARY)
131
132 include $(CLEAR_VARS)
133 LOCAL_MODULE := OcctTKOffset
134 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKOffset.so
135 include $(PREBUILT_SHARED_LIBRARY)
136
137 include $(CLEAR_VARS)
138 LOCAL_MODULE := OcctTKXSBase
139 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKXSBase.so
140 include $(PREBUILT_SHARED_LIBRARY)
141
142 include $(CLEAR_VARS)
143 LOCAL_MODULE := OcctTKIGES
144 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKIGES.so
145 include $(PREBUILT_SHARED_LIBRARY)
146
147 include $(CLEAR_VARS)
148 LOCAL_MODULE := OcctTKSTEPBase
149 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKSTEPBase.so
150 include $(PREBUILT_SHARED_LIBRARY)
151
152 include $(CLEAR_VARS)
153 LOCAL_MODULE := OcctTKSTEPAttr
154 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKSTEPAttr.so
155 include $(PREBUILT_SHARED_LIBRARY)
156
157 include $(CLEAR_VARS)
158 LOCAL_MODULE := OcctTKSTEP209
159 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKSTEP209.so
160 include $(PREBUILT_SHARED_LIBRARY)
161
162 include $(CLEAR_VARS)
163 LOCAL_MODULE := OcctTKSTEP
164 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKSTEP.so
165 include $(PREBUILT_SHARED_LIBRARY)
166
167 # OCCT visualization
168 include $(CLEAR_VARS)
169 LOCAL_MODULE := OcctTKService
170 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKService.so
171 include $(PREBUILT_SHARED_LIBRARY)
172
173 include $(CLEAR_VARS)
174 LOCAL_MODULE := OcctTKHLR
175 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKHLR.so
176 include $(PREBUILT_SHARED_LIBRARY)
177
178 include $(CLEAR_VARS)
179 LOCAL_MODULE := OcctTKV3d
180 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKV3d.so
181 include $(PREBUILT_SHARED_LIBRARY)
182
183 include $(CLEAR_VARS)
184 LOCAL_MODULE := OcctTKOpenGl
185 LOCAL_SRC_FILES := $(OCCT_LIBS)/$(TARGET_ARCH_ABI)/libTKOpenGl.so
186 include $(PREBUILT_SHARED_LIBRARY)
187
188 # our sample
189 include $(CLEAR_VARS)
190 LOCAL_MODULE           := libTKJniSample
191 LOCAL_C_INCLUDES       := $(STL_INC)
192 #LOCAL_STATIC_LIBRARIES := $(STL_LIB) does not work
193 LOCAL_CFLAGS           := -Wall -std=c++11
194 LOCAL_CPP_EXTENSION    := .cxx .cpp
195 LOCAL_CPP_FEATURES     := rtti exceptions
196 LOCAL_SRC_FILES        := OcctJni_Viewer.cxx OcctJni_Window.cxx OcctJni_MsgPrinter.cxx
197 LOCAL_SHARED_LIBRARIES := OcctTKernel OcctTKMath OcctTKG2d OcctTKG3d OcctTKGeomBase OcctTKBRep OcctTKGeomAlgo OcctTKTopAlgo OcctTKShHealing OcctTKMesh OcctTKPrim
198 LOCAL_SHARED_LIBRARIES += OcctTKIGES OcctTKSTEP OcctTKXSBase
199 LOCAL_SHARED_LIBRARIES += OcctTKService OcctTKHLR OcctTKV3d OcctTKOpenGl
200 LOCAL_SHARED_LIBRARIES += SharedStl
201 LOCAL_LDLIBS           := -llog -lGLESv2 -lEGL
202
203 #LOCAL_LDLIBS += $(STL_LIB)
204
205 include $(BUILD_SHARED_LIBRARY)