1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
Index: modules/highgui/CMakeLists.txt
===================================================================
--- modules/highgui/CMakeLists.txt (revision 3454)
+++ modules/highgui/CMakeLists.txt (working copy)
@@ -1,3 +1,21 @@
+if(ANDROID)
+
+set(high_gui_android_srcs src/bitstrm.cpp
+ src/cap.cpp
+ src/grfmt_base.cpp
+ src/grfmt_bmp.cpp
+ src/grfmt_jpeg.cpp
+ src/grfmt_png.cpp
+ src/grfmt_tiff.cpp
+ src/loadsave.cpp
+ src/precomp.cpp
+ src/utils.cpp
+ src/grfmt_sunras.cpp
+ src/grfmt_pxm.cpp
+ src/window.cpp )
+define_android_manual(highgui "${high_gui_android_srcs}" "$(OpenCVInclude) $(LOCAL_PATH)/include")
+
+else()
# ----------------------------------------------------------------------------
# CMake file for highgui. See root CMakeLists.txt
# Some parts taken from version of Hartmut Seichter, HIT Lab NZ.
@@ -332,3 +350,5 @@
install(FILES ${highgui_ext_hdrs}
DESTINATION include/opencv2/highgui
COMPONENT main)
+
+endif()#android
Index: modules/features2d/src/sift.cpp
===================================================================
--- modules/features2d/src/sift.cpp (revision 3454)
+++ modules/features2d/src/sift.cpp (working copy)
@@ -172,6 +172,7 @@
typedef Keypoints::iterator KeypointsIter ; ///< Keypoint list iter datatype
typedef Keypoints::const_iterator KeypointsConstIter ; ///< Keypoint list const iter datatype
+#undef _S
/** @brief Constructors and destructors */
/*@{*/
Sift(const pixel_t* _im_pt, int _width, int _height,
Index: modules/features2d/CMakeLists.txt
===================================================================
--- modules/features2d/CMakeLists.txt (revision 3454)
+++ modules/features2d/CMakeLists.txt (working copy)
@@ -1 +1,2 @@
-define_opencv_module(features2d opencv_core opencv_imgproc opencv_calib3d opencv_highgui)
\ No newline at end of file
+define_opencv_module(features2d opencv_core opencv_imgproc opencv_calib3d opencv_highgui)
+
Index: modules/CMakeLists.txt
===================================================================
--- modules/CMakeLists.txt (revision 3454)
+++ modules/CMakeLists.txt (working copy)
@@ -1,3 +1,7 @@
+if(ANDROID)
+ configure_file("${CMAKE_SOURCE_DIR}/Android.mk.modules.in" "${CMAKE_CURRENT_BINARY_DIR}/Android.mk")
+endif()
+
add_subdirectory(calib3d)
add_subdirectory(core)
add_subdirectory(features2d)
@@ -20,8 +24,11 @@
endif()
add_subdirectory(video)
+
+if(!ANDROID)
add_subdirectory(haartraining)
add_subdirectory(traincascade)
+endif()
#add_subdirectory(gpu)
Index: 3rdparty/zlib/CMakeLists.txt
===================================================================
--- 3rdparty/zlib/CMakeLists.txt (revision 3454)
+++ 3rdparty/zlib/CMakeLists.txt (working copy)
@@ -1,3 +1,7 @@
+if(ANDROID)
+define_3rdparty_module(zlib)
+else()
+
# ----------------------------------------------------------------------------
# CMake file for zlib. See root CMakeLists.txt
#
@@ -35,3 +39,5 @@
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib"
)
+
+endif()
Index: 3rdparty/lapack/CMakeLists.txt
===================================================================
--- 3rdparty/lapack/CMakeLists.txt (revision 3454)
+++ 3rdparty/lapack/CMakeLists.txt (working copy)
@@ -2,6 +2,10 @@
# CMake file for opencv_lapack. See root CMakeLists.txt
#
# ----------------------------------------------------------------------------
+if(ANDROID)
+define_3rdparty_module(opencv_lapack)
+else()
+
project(opencv_lapack)
# List of C++ files:
@@ -57,3 +61,4 @@
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty/lib
)
+endif() #android
Index: 3rdparty/libjasper/CMakeLists.txt
===================================================================
--- 3rdparty/libjasper/CMakeLists.txt (revision 3454)
+++ 3rdparty/libjasper/CMakeLists.txt (working copy)
@@ -1,3 +1,8 @@
+if(ANDROID)
+define_3rdparty_module(jasper)
+else()
+
+
# ----------------------------------------------------------------------------
# CMake file for libjasper. See root CMakeLists.txt
#
@@ -4,6 +9,7 @@
# ----------------------------------------------------------------------------
project(libjasper)
+
add_definitions(-DEXCLUDE_MIF_SUPPORT -DEXCLUDE_PNM_SUPPORT -DEXCLUDE_BMP_SUPPORT -DEXCLUDE_RAS_SUPPORT -DEXCLUDE_JPG_SUPPORT -DEXCLUDE_PGX_SUPPORT)
# List of C++ files:
@@ -41,6 +47,8 @@
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-implicit-function-declaration -Wno-unused")
endif()
+endif()#!android
+
set_target_properties(${the_target}
PROPERTIES
OUTPUT_NAME "${the_target}"
Index: 3rdparty/libpng/CMakeLists.txt
===================================================================
--- 3rdparty/libpng/CMakeLists.txt (revision 3454)
+++ 3rdparty/libpng/CMakeLists.txt (working copy)
@@ -1,3 +1,7 @@
+if(ANDROID)
+define_3rdparty_module(png)
+else()
+#endif()#android
# ----------------------------------------------------------------------------
# CMake file for libpng. See root CMakeLists.txt
#
@@ -38,3 +42,4 @@
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib"
)
+endif()#android
Index: 3rdparty/libjpeg/CMakeLists.txt
===================================================================
--- 3rdparty/libjpeg/CMakeLists.txt (revision 3454)
+++ 3rdparty/libjpeg/CMakeLists.txt (working copy)
@@ -1,3 +1,7 @@
+if(ANDROID)
+define_3rdparty_module(jpeg)
+else()
+#endif()#android
# ----------------------------------------------------------------------------
# CMake file for libjpeg. See root CMakeLists.txt
#
@@ -39,3 +43,4 @@
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty/lib
)
+endif()#android
Index: 3rdparty/CMakeLists.txt
===================================================================
--- 3rdparty/CMakeLists.txt (revision 3454)
+++ 3rdparty/CMakeLists.txt (working copy)
@@ -1,3 +1,10 @@
+if(ANDROID)
+ configure_file("${CMAKE_SOURCE_DIR}/Android.mk.modules.in" "${CMAKE_CURRENT_BINARY_DIR}/Android.mk")
+ add_subdirectory(libpng)
+ add_subdirectory(libjpeg)
+ add_subdirectory(libjasper)
+endif()
+
add_subdirectory(flann)
add_subdirectory(lapack)
add_subdirectory(zlib)
Index: 3rdparty/flann/CMakeLists.txt
===================================================================
--- 3rdparty/flann/CMakeLists.txt (revision 3454)
+++ 3rdparty/flann/CMakeLists.txt (working copy)
@@ -1,3 +1,7 @@
+if(ANDROID)
+file(GLOB_RECURSE flann_sources_cpp *.cpp)
+define_android_manual(flann "${flann_sources_cpp}" "$(LOCAL_PATH)/../include $(LOCAL_PATH)/../include/flann $(LOCAL_PATH)/nn $(LOCAL_PATH)/algorithms $(LOCAL_PATH)/util")
+else()
if (DEFINED OPENCV_VERSION)
# ----------------------------------------------------------------------------
@@ -105,3 +109,4 @@
)
ENDIF()
+endif()#android