package/dhcp/S80dhcp-server: allow empty INTERFACES
[buildroot-gz.git] / package / opencv / opencv.mk
blob21c0268a00fc8032716ee9743a7ec15ce389bb5d
1 ################################################################################
3 # opencv
5 ################################################################################
7 OPENCV_VERSION = 2.4.10
8 OPENCV_SITE = $(call github,itseez,opencv,$(OPENCV_VERSION))
9 OPENCV_INSTALL_STAGING = YES
10 OPENCV_LICENSE = BSD-3c
11 OPENCV_LICENSE_FILES = LICENSE
13 # OpenCV component options
14 OPENCV_CONF_OPTS += \
15 -DBUILD_PERF_TESTS=$(if $(BR2_PACKAGE_OPENCV_BUILD_PERF_TESTS),ON,OFF) \
16 -DBUILD_TESTS=$(if $(BR2_PACKAGE_OPENCV_BUILD_TESTS),ON,OFF) \
17 -DBUILD_WITH_DEBUG_INFO=OFF
19 # OpenCV build options
20 OPENCV_CONF_OPTS += \
21 -DBUILD_WITH_STATIC_CRT=OFF \
22 -DENABLE_FAST_MATH=ON \
23 -DENABLE_NOISY_WARNINGS=OFF \
24 -DENABLE_OMIT_FRAME_POINTER=ON \
25 -DENABLE_PRECOMPILED_HEADERS=OFF \
26 -DENABLE_PROFILING=OFF \
27 -DOPENCV_CAN_BREAK_BINARY_COMPATIBILITY=ON
29 # OpenCV link options
30 OPENCV_CONF_OPTS += \
31 -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF \
32 -DCMAKE_SKIP_RPATH=OFF \
33 -DCMAKE_USE_RELATIVE_PATHS=OFF
35 # OpenCV packaging options:
36 OPENCV_CONF_OPTS += \
37 -DBUILD_PACKAGE=OFF \
38 -DENABLE_SOLUTION_FOLDERS=OFF \
39 -DINSTALL_CREATE_DISTRIB=OFF
41 # OpenCV module selection
42 OPENCV_CONF_OPTS += \
43 -DBUILD_opencv_androidcamera=OFF \
44 -DBUILD_opencv_apps=OFF \
45 -DBUILD_opencv_calib3d=$(if $(BR2_PACKAGE_OPENCV_LIB_CALIB3D),ON,OFF) \
46 -DBUILD_opencv_contrib=$(if $(BR2_PACKAGE_OPENCV_LIB_CONTRIB),ON,OFF) \
47 -DBUILD_opencv_core=ON \
48 -DBUILD_opencv_dynamicuda=OFF \
49 -DBUILD_opencv_features2d=$(if $(BR2_PACKAGE_OPENCV_LIB_FEATURES2D),ON,OFF) \
50 -DBUILD_opencv_flann=$(if $(BR2_PACKAGE_OPENCV_LIB_FLANN),ON,OFF) \
51 -DBUILD_opencv_gpu=$(if $(BR2_PACKAGE_OPENCV_LIB_GPU),ON,OFF) \
52 -DBUILD_opencv_highgui=$(if $(BR2_PACKAGE_OPENCV_LIB_HIGHGUI),ON,OFF) \
53 -DBUILD_opencv_imgproc=$(if $(BR2_PACKAGE_OPENCV_LIB_IMGPROC),ON,OFF) \
54 -DBUILD_opencv_java=OFF \
55 -DBUILD_opencv_legacy=$(if $(BR2_PACKAGE_OPENCV_LIB_LEGACY),ON,OFF) \
56 -DBUILD_opencv_ml=$(if $(BR2_PACKAGE_OPENCV_LIB_ML),ON,OFF) \
57 -DBUILD_opencv_nonfree=$(if $(BR2_PACKAGE_OPENCV_LIB_NONFREE),ON,OFF) \
58 -DBUILD_opencv_objdetect=$(if $(BR2_PACKAGE_OPENCV_LIB_OBJDETECT),ON,OFF) \
59 -DBUILD_opencv_ocl=OFF \
60 -DBUILD_opencv_photo=$(if $(BR2_PACKAGE_OPENCV_LIB_PHOTO),ON,OFF) \
61 -DBUILD_opencv_python=OFF \
62 -DBUILD_opencv_stitching=$(if $(BR2_PACKAGE_OPENCV_LIB_STITCHING),ON,OFF) \
63 -DBUILD_opencv_superres=$(if $(BR2_PACKAGE_OPENCV_LIB_SUPERRES),ON,OFF) \
64 -DBUILD_opencv_ts=$(if $(BR2_PACKAGE_OPENCV_LIB_TS),ON,OFF) \
65 -DBUILD_opencv_video=$(if $(BR2_PACKAGE_OPENCV_LIB_VIDEO),ON,OFF) \
66 -DBUILD_opencv_videostab=$(if $(BR2_PACKAGE_OPENCV_LIB_VIDEOSTAB),ON,OFF) \
67 -DBUILD_opencv_world=OFF
69 # Hardware support options.
71 # * PowerPC support is turned off since its only effect is altering CFLAGS,
72 # adding '-mcpu=G3 -mtune=G5' to them, which is already handled by Buildroot.
73 OPENCV_CONF_OPTS += \
74 -DENABLE_AVX=$(if $(BR2_X86_CPU_HAS_AVX),ON,OFF) \
75 -DENABLE_AVX2=$(if $(BR2_X86_CPU_HAS_AVX2),ON,OFF) \
76 -DENABLE_POWERPC=OFF \
77 -DENABLE_SSE=$(if $(BR2_X86_CPU_HAS_SSE),ON,OFF) \
78 -DENABLE_SSE2=$(if $(BR2_X86_CPU_HAS_SSE2),ON,OFF) \
79 -DENABLE_SSE3=$(if $(BR2_X86_CPU_HAS_SSE3),ON,OFF) \
80 -DENABLE_SSE41=$(if $(BR2_X86_CPU_HAS_SSE4),ON,OFF) \
81 -DENABLE_SSE42=$(if $(BR2_X86_CPU_HAS_SSE42),ON,OFF) \
82 -DENABLE_SSSE3=$(if $(BR2_X86_CPU_HAS_SSSE3),ON,OFF)
84 # Cuda stuff
85 OPENCV_CONF_OPTS += \
86 -DWITH_CUBLAS=OFF \
87 -DWITH_CUDA=OFF \
88 -DWITH_CUFFT=OFF
90 # NVidia stuff
91 OPENCV_CONF_OPTS += -DWITH_NVCUVID=OFF
93 # AMD stuff
94 OPENCV_CONF_OPTS += \
95 -DWITH_OPENCLAMDBLAS=OFF \
96 -DWITH_OPENCLAMDFFT=OFF
98 # Intel stuff
99 OPENCV_CONF_OPTS += \
100 -DWITH_INTELPERC=OFF \
101 -DWITH_IPP=OFF \
102 -DWITH_TBB=OFF
104 # Smartek stuff
105 OPENCV_CONF_OPTS += -DWITH_GIGEAPI=OFF
107 # Prosilica stuff
108 OPENCV_CONF_OPTS += -DWITH_PVAPI=OFF
110 # Ximea stuff
111 OPENCV_CONF_OPTS += -DWITH_XIMEA=OFF
113 # Non-Linux support (Android options) must remain OFF:
114 OPENCV_CONF_OPTS += \
115 -DBUILD_ANDROID_CAMERA_WRAPPER=OFF \
116 -DBUILD_ANDROID_EXAMPLES=OFF \
117 -DBUILD_FAT_JAVA_LIB=OFF \
118 -DBUILD_JAVA_SUPPORT=OFF \
119 -DINSTALL_ANDROID_EXAMPLES=OFF \
120 -DWITH_ANDROID_CAMERA=OFF
122 # Non-Linux support (Mac OSX options) must remain OFF:
123 OPENCV_CONF_OPTS += \
124 -DWITH_AVFOUNDATION=OFF \
125 -DWITH_CARBON=OFF \
126 -DWITH_QUICKTIME=OFF
128 # Non-Linux support (Windows options) must remain OFF:
129 OPENCV_CONF_OPTS += \
130 -DWITH_CSTRIPES=OFF \
131 -DWITH_DSHOW=OFF \
132 -DWITH_MSMF=OFF \
133 -DWITH_VFW=OFF \
134 -DWITH_VIDEOINPUT=OFF \
135 -DWITH_WIN32UI=OFF
137 # Software/3rd-party support options.
138 OPENCV_CONF_OPTS += \
139 -DBUILD_JASPER=OFF \
140 -DBUILD_JPEG=OFF \
141 -DBUILD_NEW_PYTHON_SUPPORT=OFF \
142 -DBUILD_OPENEXR=OFF \
143 -DBUILD_PNG=OFF \
144 -DBUILD_TIFF=OFF \
145 -DBUILD_ZLIB=OFF \
146 -DINSTALL_C_EXAMPLES=OFF \
147 -DINSTALL_PYTHON_EXAMPLES=OFF \
148 -DINSTALL_TO_MANGLED_PATHS=OFF
150 # Disabled features (mostly because they are not available in Buildroot), but
151 # - eigen: OpenCV does not use it, not take any benefit from it.
152 OPENCV_CONF_OPTS += \
153 -DWITH_1394=OFF \
154 -DWITH_EIGEN=OFF \
155 -DWITH_IMAGEIO=OFF \
156 -DWITH_OPENCL=OFF \
157 -DWITH_OPENEXR=OFF \
158 -DWITH_OPENGL=OFF \
159 -DWITH_OPENMP=OFF \
160 -DWITH_OPENNI=OFF \
161 -DWITH_UNICAP=OFF \
162 -DWITH_XINE=OFF
164 OPENCV_DEPENDENCIES += zlib
166 ifeq ($(BR2_PACKAGE_OPENCV_WITH_FFMPEG),y)
167 OPENCV_CONF_OPTS += -DWITH_FFMPEG=ON
168 OPENCV_DEPENDENCIES += ffmpeg bzip2
169 else
170 OPENCV_CONF_OPTS += -DWITH_FFMPEG=OFF
171 endif
173 ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER),y)
174 OPENCV_CONF_OPTS += -DWITH_GSTREAMER_0_10=ON
175 OPENCV_DEPENDENCIES += gstreamer gst-plugins-base
176 else
177 OPENCV_CONF_OPTS += -DWITH_GSTREAMER_0_10=OFF
178 endif
180 ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER1),y)
181 OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON
182 OPENCV_DEPENDENCIES += gstreamer1 gst1-plugins-base
183 else
184 OPENCV_CONF_OPTS += -DWITH_GSTREAMER=OFF
185 endif
187 ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK),y)
188 OPENCV_CONF_OPTS += -DWITH_GTK=ON
189 OPENCV_DEPENDENCIES += libgtk2
190 else
191 OPENCV_CONF_OPTS += -DWITH_GTK=OFF
192 endif
194 ifeq ($(BR2_PACKAGE_OPENCV_WITH_JASPER),y)
195 OPENCV_CONF_OPTS += -DWITH_JASPER=ON
196 OPENCV_DEPENDENCIES += jasper
197 else
198 OPENCV_CONF_OPTS += -DWITH_JASPER=OFF
199 endif
201 ifeq ($(BR2_PACKAGE_OPENCV_WITH_JPEG),y)
202 OPENCV_CONF_OPTS += -DWITH_JPEG=ON
203 OPENCV_DEPENDENCIES += jpeg
204 else
205 OPENCV_CONF_OPTS += -DWITH_JPEG=OFF
206 endif
208 ifeq ($(BR2_PACKAGE_OPENCV_WITH_PNG),y)
209 OPENCV_CONF_OPTS += -DWITH_PNG=ON
210 OPENCV_DEPENDENCIES += libpng
211 else
212 OPENCV_CONF_OPTS += -DWITH_PNG=OFF
213 endif
215 ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT),y)
216 OPENCV_CONF_OPTS += -DWITH_QT=4
217 OPENCV_DEPENDENCIES += qt
218 else
219 OPENCV_CONF_OPTS += -DWITH_QT=OFF
220 endif
222 ifeq ($(BR2_PACKAGE_OPENCV_WITH_TIFF),y)
223 OPENCV_CONF_OPTS += -DWITH_TIFF=ON
224 OPENCV_DEPENDENCIES += tiff
225 else
226 OPENCV_CONF_OPTS += -DWITH_TIFF=OFF
227 endif
229 ifeq ($(BR2_PACKAGE_OPENCV_WITH_V4L),y)
230 OPENCV_CONF_OPTS += \
231 -DWITH_LIBV4L=$(if $(BR2_PACKAGE_LIBV4L),ON,OFF) \
232 -DWITH_V4L=ON
233 OPENCV_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBV4L),libv4l)
234 else
235 OPENCV_CONF_OPTS += -DWITH_V4L=OFF -DWITH_LIBV4L=OFF
236 endif
238 # Installation hooks:
239 define OPENCV_CLEAN_INSTALL_DOC
240 $(RM) -fr $(TARGET_DIR)/usr/share/OpenCV/doc
241 endef
242 OPENCV_POST_INSTALL_TARGET_HOOKS += OPENCV_CLEAN_INSTALL_DOC
244 define OPENCV_CLEAN_INSTALL_CMAKE
245 $(RM) -f $(TARGET_DIR)/usr/share/OpenCV/OpenCVConfig*.cmake
246 endef
247 OPENCV_POST_INSTALL_TARGET_HOOKS += OPENCV_CLEAN_INSTALL_CMAKE
249 ifneq ($(BR2_PACKAGE_OPENCV_INSTALL_DATA),y)
250 define OPENCV_CLEAN_INSTALL_DATA
251 $(RM) -fr $(TARGET_DIR)/usr/share/OpenCV/haarcascades \
252 $(TARGET_DIR)/usr/share/OpenCV/lbpcascades
253 endef
254 OPENCV_POST_INSTALL_TARGET_HOOKS += OPENCV_CLEAN_INSTALL_DATA
255 endif
257 $(eval $(cmake-package))