2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2011-10-20 19:09:18 +02:00
|
|
|
#
|
2013-06-06 01:53:29 +02:00
|
|
|
# opencv
|
2011-10-20 19:09:18 +02:00
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2013-06-06 01:53:25 +02:00
|
|
|
|
2015-06-25 21:59:43 +02:00
|
|
|
OPENCV_VERSION = 3.0.0
|
2014-04-23 01:15:39 +02:00
|
|
|
OPENCV_SITE = $(call github,itseez,opencv,$(OPENCV_VERSION))
|
2011-10-20 19:09:18 +02:00
|
|
|
OPENCV_INSTALL_STAGING = YES
|
2014-07-02 14:40:05 +02:00
|
|
|
OPENCV_LICENSE = BSD-3c
|
2014-09-29 11:08:50 +02:00
|
|
|
OPENCV_LICENSE_FILES = LICENSE
|
2011-10-20 19:09:18 +02:00
|
|
|
|
2014-04-23 01:15:41 +02:00
|
|
|
# OpenCV component options
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DBUILD_DOCS=OFF \
|
2012-07-16 23:37:30 +02:00
|
|
|
-DBUILD_PERF_TESTS=$(if $(BR2_PACKAGE_OPENCV_BUILD_PERF_TESTS),ON,OFF) \
|
2015-06-25 21:59:42 +02:00
|
|
|
-DBUILD_TESTS=$(if $(BR2_PACKAGE_OPENCV_BUILD_TESTS),ON,OFF) \
|
|
|
|
-DBUILD_WITH_DEBUG_INFO=OFF
|
2014-04-23 01:15:41 +02:00
|
|
|
|
2015-06-25 21:59:43 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_BUILD_TESTS)$(BR2_PACKAGE_OPENCV_BUILD_PERF_TESTS),)
|
|
|
|
OPENCV_CONF_OPTS += -DINSTALL_TEST=OFF
|
|
|
|
else
|
|
|
|
OPENCV_CONF_OPTS += -DINSTALL_TEST=ON
|
|
|
|
endif
|
|
|
|
|
2014-04-23 01:15:41 +02:00
|
|
|
# OpenCV build options
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DBUILD_WITH_STATIC_CRT=OFF \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DENABLE_COVERAGE=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DENABLE_FAST_MATH=ON \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DENABLE_IMPL_COLLECTION=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DENABLE_NOISY_WARNINGS=OFF \
|
|
|
|
-DENABLE_OMIT_FRAME_POINTER=ON \
|
2014-04-23 01:15:41 +02:00
|
|
|
-DENABLE_PRECOMPILED_HEADERS=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DENABLE_PROFILING=OFF \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DOPENCV_WARNINGS_ARE_ERRORS=OFF
|
2014-04-23 01:15:41 +02:00
|
|
|
|
|
|
|
# OpenCV link options
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2012-07-16 23:37:30 +02:00
|
|
|
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DCMAKE_SKIP_RPATH=OFF \
|
2014-04-23 01:15:41 +02:00
|
|
|
-DCMAKE_USE_RELATIVE_PATHS=OFF
|
|
|
|
|
|
|
|
# OpenCV packaging options:
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DBUILD_PACKAGE=OFF \
|
2014-04-23 01:15:41 +02:00
|
|
|
-DENABLE_SOLUTION_FOLDERS=OFF \
|
|
|
|
-DINSTALL_CREATE_DISTRIB=OFF
|
2012-07-16 23:37:30 +02:00
|
|
|
|
|
|
|
# OpenCV module selection
|
2015-06-25 21:59:43 +02:00
|
|
|
# * Modules on:
|
|
|
|
# - core: if not set, opencv does not build anything
|
|
|
|
# - hal: core's dependency
|
|
|
|
# * Modules off:
|
|
|
|
# - android*: android stuff
|
|
|
|
# - apps: programs for training classifiers
|
|
|
|
# - java: java bindings
|
|
|
|
# - viz: missing VTK dependency
|
|
|
|
# - world: all-in-one module
|
|
|
|
#
|
|
|
|
# * Contrib modules from [1] are disabled:
|
|
|
|
# - opencv_contrib package is not available in Buildroot;
|
|
|
|
# - OPENCV_EXTRA_MODULES_PATH is not set.
|
|
|
|
#
|
|
|
|
# [1] https://github.com/Itseez/opencv_contrib
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DBUILD_opencv_androidcamera=OFF \
|
|
|
|
-DBUILD_opencv_apps=OFF \
|
|
|
|
-DBUILD_opencv_calib3d=$(if $(BR2_PACKAGE_OPENCV_LIB_CALIB3D),ON,OFF) \
|
|
|
|
-DBUILD_opencv_core=ON \
|
2012-07-16 23:37:30 +02:00
|
|
|
-DBUILD_opencv_features2d=$(if $(BR2_PACKAGE_OPENCV_LIB_FEATURES2D),ON,OFF) \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DBUILD_opencv_flann=$(if $(BR2_PACKAGE_OPENCV_LIB_FLANN),ON,OFF) \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DBUILD_opencv_hal=ON \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DBUILD_opencv_highgui=$(if $(BR2_PACKAGE_OPENCV_LIB_HIGHGUI),ON,OFF) \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DBUILD_opencv_imgcodecs=$(if $(BR2_PACKAGE_OPENCV_LIB_IMGCODECS),ON,OFF) \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DBUILD_opencv_imgproc=$(if $(BR2_PACKAGE_OPENCV_LIB_IMGPROC),ON,OFF) \
|
|
|
|
-DBUILD_opencv_java=OFF \
|
|
|
|
-DBUILD_opencv_ml=$(if $(BR2_PACKAGE_OPENCV_LIB_ML),ON,OFF) \
|
2012-07-16 23:37:30 +02:00
|
|
|
-DBUILD_opencv_objdetect=$(if $(BR2_PACKAGE_OPENCV_LIB_OBJDETECT),ON,OFF) \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DBUILD_opencv_photo=$(if $(BR2_PACKAGE_OPENCV_LIB_PHOTO),ON,OFF) \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DBUILD_opencv_shape=$(if $(BR2_PACKAGE_OPENCV_LIB_SHAPE),ON,OFF) \
|
2012-07-16 23:37:30 +02:00
|
|
|
-DBUILD_opencv_stitching=$(if $(BR2_PACKAGE_OPENCV_LIB_STITCHING),ON,OFF) \
|
2014-04-23 01:15:44 +02:00
|
|
|
-DBUILD_opencv_superres=$(if $(BR2_PACKAGE_OPENCV_LIB_SUPERRES),ON,OFF) \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DBUILD_opencv_ts=$(if $(BR2_PACKAGE_OPENCV_LIB_TS),ON,OFF) \
|
|
|
|
-DBUILD_opencv_video=$(if $(BR2_PACKAGE_OPENCV_LIB_VIDEO),ON,OFF) \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DBUILD_opencv_videoio=$(if $(BR2_PACKAGE_OPENCV_LIB_VIDEOIO),ON,OFF) \
|
2012-07-16 23:37:30 +02:00
|
|
|
-DBUILD_opencv_videostab=$(if $(BR2_PACKAGE_OPENCV_LIB_VIDEOSTAB),ON,OFF) \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DBUILD_opencv_viz=OFF \
|
2012-07-16 23:37:30 +02:00
|
|
|
-DBUILD_opencv_world=OFF
|
|
|
|
|
|
|
|
# Hardware support options.
|
|
|
|
#
|
|
|
|
# * PowerPC support is turned off since its only effect is altering CFLAGS,
|
|
|
|
# adding '-mcpu=G3 -mtune=G5' to them, which is already handled by Buildroot.
|
2015-06-25 21:59:43 +02:00
|
|
|
# * fma3 and popcnt support is disabled because according to gcc manual [2], it
|
|
|
|
# is only available on x86_64 haswell, broadwell and knl architecture.
|
|
|
|
#
|
|
|
|
# [2] https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gcc/x86-Options.html#x86-Options
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-25 21:59:42 +02:00
|
|
|
-DENABLE_AVX=$(if $(BR2_X86_CPU_HAS_AVX),ON,OFF) \
|
|
|
|
-DENABLE_AVX2=$(if $(BR2_X86_CPU_HAS_AVX2),ON,OFF) \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DENABLE_FMA3=OFF \
|
|
|
|
-DENABLE_POPCNT=OFF \
|
2012-07-16 23:37:30 +02:00
|
|
|
-DENABLE_POWERPC=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DENABLE_SSE=$(if $(BR2_X86_CPU_HAS_SSE),ON,OFF) \
|
|
|
|
-DENABLE_SSE2=$(if $(BR2_X86_CPU_HAS_SSE2),ON,OFF) \
|
|
|
|
-DENABLE_SSE3=$(if $(BR2_X86_CPU_HAS_SSE3),ON,OFF) \
|
|
|
|
-DENABLE_SSE41=$(if $(BR2_X86_CPU_HAS_SSE4),ON,OFF) \
|
2014-04-23 01:15:48 +02:00
|
|
|
-DENABLE_SSE42=$(if $(BR2_X86_CPU_HAS_SSE42),ON,OFF) \
|
2012-07-16 23:37:30 +02:00
|
|
|
-DENABLE_SSSE3=$(if $(BR2_X86_CPU_HAS_SSSE3),ON,OFF)
|
|
|
|
|
2014-04-23 01:15:42 +02:00
|
|
|
# Cuda stuff
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DBUILD_CUDA_STUBS=OFF \
|
|
|
|
-DBUILD_opencv_cudaarithm=OFF \
|
|
|
|
-DBUILD_opencv_cudabgsegm=OFF \
|
|
|
|
-DBUILD_opencv_cudacodec=OFF \
|
|
|
|
-DBUILD_opencv_cudafeatures2d=OFF \
|
|
|
|
-DBUILD_opencv_cudafilters=OFF \
|
|
|
|
-DBUILD_opencv_cudaimgproc=OFF \
|
|
|
|
-DBUILD_opencv_cudalegacy=OFF \
|
|
|
|
-DBUILD_opencv_cudaobjdetect=OFF \
|
|
|
|
-DBUILD_opencv_cudaoptflow=OFF \
|
|
|
|
-DBUILD_opencv_cudastereo=OFF \
|
|
|
|
-DBUILD_opencv_cudawarping=OFF \
|
|
|
|
-DBUILD_opencv_cudev=OFF \
|
2014-04-23 01:15:42 +02:00
|
|
|
-DWITH_CUBLAS=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DWITH_CUDA=OFF \
|
2014-04-23 01:15:42 +02:00
|
|
|
-DWITH_CUFFT=OFF
|
|
|
|
|
|
|
|
# NVidia stuff
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_NVCUVID=OFF
|
2014-04-23 01:15:42 +02:00
|
|
|
|
|
|
|
# AMD stuff
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-25 21:59:42 +02:00
|
|
|
-DWITH_OPENCLAMDBLAS=OFF \
|
|
|
|
-DWITH_OPENCLAMDFFT=OFF
|
2014-04-23 01:15:42 +02:00
|
|
|
|
|
|
|
# Intel stuff
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DBUILD_WITH_DYNAMIC_IPP=OFF \
|
2014-04-23 01:15:42 +02:00
|
|
|
-DWITH_INTELPERC=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DWITH_IPP=OFF \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DWITH_IPP_A=OFF \
|
2014-04-23 01:15:42 +02:00
|
|
|
-DWITH_TBB=OFF
|
|
|
|
|
|
|
|
# Smartek stuff
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_GIGEAPI=OFF
|
2014-04-23 01:15:42 +02:00
|
|
|
|
|
|
|
# Prosilica stuff
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_PVAPI=OFF
|
2014-04-23 01:15:42 +02:00
|
|
|
|
|
|
|
# Ximea stuff
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_XIMEA=OFF
|
2014-04-23 01:15:42 +02:00
|
|
|
|
2014-04-23 01:15:43 +02:00
|
|
|
# Non-Linux support (Android options) must remain OFF:
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DANDROID=OFF \
|
2012-07-16 23:37:30 +02:00
|
|
|
-DBUILD_ANDROID_CAMERA_WRAPPER=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DBUILD_ANDROID_EXAMPLES=OFF \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DBUILD_ANDROID_SERVICE=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DBUILD_FAT_JAVA_LIB=OFF \
|
2015-06-25 21:59:42 +02:00
|
|
|
-DINSTALL_ANDROID_EXAMPLES=OFF \
|
|
|
|
-DWITH_ANDROID_CAMERA=OFF
|
2014-04-23 01:15:43 +02:00
|
|
|
|
|
|
|
# Non-Linux support (Mac OSX options) must remain OFF:
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DWITH_AVFOUNDATION=OFF \
|
|
|
|
-DWITH_CARBON=OFF \
|
2014-04-23 01:15:43 +02:00
|
|
|
-DWITH_QUICKTIME=OFF
|
|
|
|
|
|
|
|
# Non-Linux support (Windows options) must remain OFF:
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2014-04-23 01:15:43 +02:00
|
|
|
-DWITH_CSTRIPES=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DWITH_DSHOW=OFF \
|
|
|
|
-DWITH_MSMF=OFF \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DWITH_PTHREADS_PF=OFF \
|
2015-06-25 21:59:42 +02:00
|
|
|
-DWITH_VFW=OFF \
|
|
|
|
-DWITH_VIDEOINPUT=OFF \
|
|
|
|
-DWITH_WIN32UI=OFF
|
2014-04-23 01:15:43 +02:00
|
|
|
|
2015-06-25 21:59:43 +02:00
|
|
|
# Software/3rd-party support options:
|
|
|
|
# - disable all examples
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DBUILD_EXAMPLES=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DBUILD_JASPER=OFF \
|
|
|
|
-DBUILD_JPEG=OFF \
|
2014-04-23 01:15:43 +02:00
|
|
|
-DBUILD_OPENEXR=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DBUILD_PNG=OFF \
|
|
|
|
-DBUILD_TIFF=OFF \
|
|
|
|
-DBUILD_ZLIB=OFF \
|
|
|
|
-DINSTALL_C_EXAMPLES=OFF \
|
|
|
|
-DINSTALL_PYTHON_EXAMPLES=OFF \
|
2014-04-23 01:15:43 +02:00
|
|
|
-DINSTALL_TO_MANGLED_PATHS=OFF
|
|
|
|
|
|
|
|
# Disabled features (mostly because they are not available in Buildroot), but
|
|
|
|
# - eigen: OpenCV does not use it, not take any benefit from it.
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DWITH_1394=OFF \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DWITH_CLP=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DWITH_EIGEN=OFF \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DWITH_GDAL=OFF \
|
|
|
|
-DWITH_GPHOTO2=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DWITH_OPENCL=OFF \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DWITH_OPENCL_SVM=OFF \
|
2014-04-23 01:15:43 +02:00
|
|
|
-DWITH_OPENEXR=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DWITH_OPENGL=OFF \
|
|
|
|
-DWITH_OPENMP=OFF \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DWITH_OPENNI2=OFF \
|
2015-06-07 12:26:27 +02:00
|
|
|
-DWITH_OPENNI=OFF \
|
|
|
|
-DWITH_UNICAP=OFF \
|
2015-06-25 21:59:43 +02:00
|
|
|
-DWITH_VTK=OFF \
|
|
|
|
-DWITH_WEBP=OFF \
|
2011-10-20 19:09:18 +02:00
|
|
|
-DWITH_XINE=OFF
|
|
|
|
|
2012-05-17 07:11:22 +02:00
|
|
|
OPENCV_DEPENDENCIES += zlib
|
|
|
|
|
2011-10-20 19:09:18 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_FFMPEG),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_FFMPEG=ON
|
2012-07-16 23:37:30 +02:00
|
|
|
OPENCV_DEPENDENCIES += ffmpeg bzip2
|
2011-10-20 19:09:18 +02:00
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_FFMPEG=OFF
|
2011-10-20 19:09:18 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER),y)
|
2015-07-05 11:40:24 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_GSTREAMER_0_10=ON
|
2011-10-20 19:09:18 +02:00
|
|
|
OPENCV_DEPENDENCIES += gstreamer gst-plugins-base
|
|
|
|
else
|
2015-07-05 11:40:24 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_GSTREAMER_0_10=OFF
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER1),y)
|
|
|
|
OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON
|
|
|
|
OPENCV_DEPENDENCIES += gstreamer1 gst1-plugins-base
|
|
|
|
else
|
|
|
|
OPENCV_CONF_OPTS += -DWITH_GSTREAMER=OFF
|
2011-10-20 19:09:18 +02:00
|
|
|
endif
|
|
|
|
|
2015-07-05 23:54:47 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK)$(BR2_PACKAGE_OPENCV_WITH_GTK3),)
|
|
|
|
OPENCV_CONF_OPTS += -DWITH_GTK=OFF -DWITH_GTK_2_X=OFF
|
|
|
|
endif
|
|
|
|
|
2011-10-20 19:09:18 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK),y)
|
2015-06-25 21:59:43 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_GTK=ON -DWITH_GTK_2_X=ON
|
2011-10-20 19:09:18 +02:00
|
|
|
OPENCV_DEPENDENCIES += libgtk2
|
2015-07-05 23:54:47 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK3),y)
|
|
|
|
OPENCV_CONF_OPTS += -DWITH_GTK=ON -DWITH_GTK_2_X=OFF
|
|
|
|
OPENCV_DEPENDENCIES += libgtk3
|
2011-10-20 19:09:18 +02:00
|
|
|
endif
|
|
|
|
|
2014-04-23 01:15:50 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_JASPER),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_JASPER=ON
|
2014-04-23 01:15:50 +02:00
|
|
|
OPENCV_DEPENDENCIES += jasper
|
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_JASPER=OFF
|
2014-04-23 01:15:50 +02:00
|
|
|
endif
|
|
|
|
|
2011-10-20 19:09:18 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_JPEG),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_JPEG=ON
|
2011-10-20 19:09:18 +02:00
|
|
|
OPENCV_DEPENDENCIES += jpeg
|
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_JPEG=OFF
|
2011-10-20 19:09:18 +02:00
|
|
|
endif
|
|
|
|
|
2015-07-05 23:54:48 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_OPENGL),y)
|
|
|
|
OPENCV_CONF_OPTS += -DWITH_OPENGL=ON
|
|
|
|
OPENCV_DEPENDENCIES += libgl
|
|
|
|
else
|
|
|
|
OPENCV_CONF_OPTS += -DWITH_OPENGL=OFF
|
|
|
|
endif
|
|
|
|
|
2015-06-25 21:59:52 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_OPENMP=$(if $(BR2_GCC_ENABLE_OPENMP),ON,OFF)
|
|
|
|
|
2011-10-20 19:09:18 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_PNG),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_PNG=ON
|
2011-10-20 19:09:18 +02:00
|
|
|
OPENCV_DEPENDENCIES += libpng
|
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_PNG=OFF
|
2011-10-20 19:09:18 +02:00
|
|
|
endif
|
|
|
|
|
2015-07-05 23:54:46 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT)$(BR2_PACKAGE_OPENCV_WITH_QT5),)
|
|
|
|
OPENCV_CONF_OPTS += -DWITH_QT=OFF
|
|
|
|
endif
|
|
|
|
|
2011-10-20 19:09:18 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_QT=4
|
2011-10-20 19:09:18 +02:00
|
|
|
OPENCV_DEPENDENCIES += qt
|
2015-07-05 23:54:46 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT5),y)
|
|
|
|
OPENCV_CONF_OPTS += -DWITH_QT=5
|
|
|
|
OPENCV_DEPENDENCIES += qt5base
|
2011-10-20 19:09:18 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_TIFF),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_TIFF=ON
|
2011-10-20 19:09:18 +02:00
|
|
|
OPENCV_DEPENDENCIES += tiff
|
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_TIFF=OFF
|
2011-10-20 19:09:18 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_WITH_V4L),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += \
|
2015-06-25 21:59:42 +02:00
|
|
|
-DWITH_LIBV4L=$(if $(BR2_PACKAGE_LIBV4L),ON,OFF) \
|
|
|
|
-DWITH_V4L=ON
|
2014-08-31 22:09:03 +02:00
|
|
|
OPENCV_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBV4L),libv4l)
|
2011-10-20 19:09:18 +02:00
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
OPENCV_CONF_OPTS += -DWITH_V4L=OFF -DWITH_LIBV4L=OFF
|
2011-10-20 19:09:18 +02:00
|
|
|
endif
|
|
|
|
|
2015-06-25 21:59:49 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENCV_LIB_PYTHON),y)
|
|
|
|
ifeq ($(BR2_PACKAGE_PYTHON),y)
|
|
|
|
OPENCV_CONF_OPTS += \
|
|
|
|
-DBUILD_opencv_python2=ON \
|
|
|
|
-DBUILD_opencv_python3=OFF \
|
|
|
|
-DPYTHON2_EXECUTABLE=$(HOST_DIR)/usr/bin/python2 \
|
|
|
|
-DPYTHON2_INCLUDE_PATH=$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR) \
|
|
|
|
-DPYTHON2_LIBRARIES=$(STAGING_DIR)/usr/lib/libpython$(PYTHON_VERSION_MAJOR).so \
|
|
|
|
-DPYTHON2_NUMPY_INCLUDE_DIRS=$(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/numpy/core/include \
|
|
|
|
-DPYTHON2_PACKAGES_PATH=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
|
|
|
|
-DPYTHON2_NUMPY_VERSION=$(PYTHON_NUMPY_VERSION)
|
|
|
|
OPENCV_DEPENDENCIES += python
|
|
|
|
else
|
|
|
|
OPENCV_CONF_OPTS += \
|
|
|
|
-DBUILD_opencv_python2=OFF \
|
|
|
|
-DBUILD_opencv_python3=ON \
|
|
|
|
-DPYTHON3_EXECUTABLE=$(HOST_DIR)/usr/bin/python3 \
|
|
|
|
-DPYTHON3_INCLUDE_PATH=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)m \
|
|
|
|
-DPYTHON3_LIBRARIES=$(STAGING_DIR)/usr/lib/libpython$(PYTHON3_VERSION_MAJOR)m.so \
|
|
|
|
-DPYTHON3_NUMPY_INCLUDE_DIRS=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/numpy/core/include \
|
|
|
|
-DPYTHON3_PACKAGES_PATH=/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
|
|
|
|
-DPYTHON3_NUMPY_VERSION=$(PYTHON_NUMPY_VERSION)
|
|
|
|
OPENCV_DEPENDENCIES += python3
|
|
|
|
endif
|
|
|
|
OPENCV_DEPENDENCIES += python-numpy
|
|
|
|
else
|
|
|
|
OPENCV_CONF_OPTS += \
|
|
|
|
-DBUILD_opencv_python2=OFF \
|
|
|
|
-DBUILD_opencv_python3=OFF
|
|
|
|
endif
|
|
|
|
|
2012-07-16 23:37:30 +02:00
|
|
|
# Installation hooks:
|
2011-10-20 19:09:18 +02:00
|
|
|
define OPENCV_CLEAN_INSTALL_DOC
|
2012-07-16 23:37:30 +02:00
|
|
|
$(RM) -fr $(TARGET_DIR)/usr/share/OpenCV/doc
|
2011-10-20 19:09:18 +02:00
|
|
|
endef
|
|
|
|
OPENCV_POST_INSTALL_TARGET_HOOKS += OPENCV_CLEAN_INSTALL_DOC
|
|
|
|
|
|
|
|
define OPENCV_CLEAN_INSTALL_CMAKE
|
2012-07-16 23:37:30 +02:00
|
|
|
$(RM) -f $(TARGET_DIR)/usr/share/OpenCV/OpenCVConfig*.cmake
|
2011-10-20 19:09:18 +02:00
|
|
|
endef
|
|
|
|
OPENCV_POST_INSTALL_TARGET_HOOKS += OPENCV_CLEAN_INSTALL_CMAKE
|
|
|
|
|
|
|
|
ifneq ($(BR2_PACKAGE_OPENCV_INSTALL_DATA),y)
|
|
|
|
define OPENCV_CLEAN_INSTALL_DATA
|
2012-07-16 23:37:30 +02:00
|
|
|
$(RM) -fr $(TARGET_DIR)/usr/share/OpenCV/haarcascades \
|
|
|
|
$(TARGET_DIR)/usr/share/OpenCV/lbpcascades
|
2011-10-20 19:09:18 +02:00
|
|
|
endef
|
|
|
|
OPENCV_POST_INSTALL_TARGET_HOOKS += OPENCV_CLEAN_INSTALL_DATA
|
|
|
|
endif
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(cmake-package))
|