From a55ba198c7a528f2719b305ca2901b56fc4f08f0 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Wed, 1 Feb 2012 19:42:15 +0000 Subject: [PATCH] - added ximea-linux patch, allow building with XIMEA m3api support Changed files: opencv-ximea-linux.patch -> 1.1 opencv.spec -> 1.39 --- opencv-ximea-linux.patch | 44 ++++++++++++++++++++++++++++++++++++++++ opencv.spec | 18 ++++++++++------ 2 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 opencv-ximea-linux.patch diff --git a/opencv-ximea-linux.patch b/opencv-ximea-linux.patch new file mode 100644 index 0000000..55e0c17 --- /dev/null +++ b/opencv-ximea-linux.patch @@ -0,0 +1,44 @@ +--- OpenCV-2.3.1/OpenCVFindXimea.cmake.orig 2011-09-12 20:45:38.000000000 +0200 ++++ OpenCV-2.3.1/OpenCVFindXimea.cmake 2012-02-01 19:18:07.619900166 +0100 +@@ -14,15 +14,13 @@ + set(XIMEA_PATH) + set(XIMEA_LIBRARY_DIR) + +-# Try to find the XIMEA API path in registry. +-GET_FILENAME_COMPONENT(XIMEA_PATH "[HKEY_CURRENT_USER\\Software\\XIMEA\\CamSupport\\API;Path]" ABSOLUTE) ++find_file(XIMEA_INC "m3Api.h" PATHS $ENV{XIMEA_INCLUDE} "/usr/include/ximea") ++find_library(XIMEA_LIB "m3api" PATHS $ENV{XIMEA_LIB} "/usr/lib${LIB_SUFFIX}") + +-if(XIMEA_PATH) ++if(XIMEA_INC AND XIMEA_LIB) ++ get_filename_component(XIMEA_LIBRARY_DIR "${XIMEA_LIB}" PATH CACHE) ++ get_filename_component(XIMEA_PATH "${XIMEA_INC}" PATH CACHE) + set(XIMEA_FOUND 1) +- +- # set LIB folders +- set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}\\x86") +- + else() + set(XIMEA_FOUND 0) + endif() +--- OpenCV-2.3.1/modules/highgui/src/cap_ximea.cpp.orig 2011-09-12 20:41:29.000000000 +0200 ++++ OpenCV-2.3.1/modules/highgui/src/cap_ximea.cpp 2012-02-01 20:12:54.750010230 +0100 +@@ -1,4 +1,4 @@ +- ++#include + #include "precomp.hpp" + + #include "xiApi.h" +@@ -245,9 +245,7 @@ + + void CvCaptureCAM_XIMEA::errMsg(char* msg, int errNum) + { +- char buf[512]; +- sprintf( buf, "%s : %d\n", msg, errNum); +- OutputDebugString(buf); ++ fprintf(stderr, "%s : %d\n", msg, errNum); + } + +-/**********************************************************************************/ +\ No newline ++/**********************************************************************************/ diff --git a/opencv.spec b/opencv.spec index 4a6a820..0e4f716 100644 --- a/opencv.spec +++ b/opencv.spec @@ -1,19 +1,21 @@ # # TODO: # - CUDA support (on bcond) -# - XIMEA? cmake file seems to be Win32-specific, but ximea.com has some Linux package # # Conditional build: +# - general options: +%bcond_with tbb # Threading Building Blocks support (everywhere) +%bcond_with sse # use SSE instructions +%bcond_with sse2 # use SSE2 instructions +# - highgui options: %bcond_without gstreamer # GStreamer support in highgui %bcond_with openni # OpenNI (Natural Interaction) support in highgui -%bcond_with pvapi # PvAPI (AVT GigE cameras) support in highgui +%bcond_with pvapi # PvAPI (AVT GigE cameras) support in highgui (proprietary) %bcond_with qt # Qt backend instead of GTK+ in highgui -%bcond_with tbb # Threading Building Blocks support (everywhere) %bcond_with unicap # Unicap support in highgui (GPL) -%bcond_with v4l # Video4Linux (even V4L2 support currently relies on V4L1 API) +%bcond_with v4l # Video4Linux in highgui (even V4L2 support currently relies on V4L1 API) +%bcond_with ximea # m3API (XIMEA cameras) support in highgui (proprietary) %bcond_with xine # XINE support in highgui (GPL) -%bcond_with sse # use SSE instructions -%bcond_with sse2 # use SSE2 instructions # %ifarch pentium3 pentium4 %{x8664} %define with_sse 1 @@ -41,11 +43,13 @@ Patch2: %{name}-unicap-c++.patch Patch3: %{name}-c.patch Patch4: %{name}-gcc.patch Patch5: %{name}-multilib.patch +Patch6: %{name}-ximea-linux.patch URL: http://opencv.willowgarage.com/ %{?with_pvapi:BuildRequires: AVT_GigE_SDK-devel} BuildRequires: OpenEXR-devel # as of OpenCV 2.3.1 there is also check for OpenNI-sensor-PrimeSense, but the result is not used %{?with_openni:BuildRequires: OpenNI-devel} +%{?with_ximea:BuildRequires: XIMEA-devel} BuildRequires: cmake >= 2.4 BuildRequires: doxygen BuildRequires: eigen >= 2 @@ -157,6 +161,7 @@ Wiązania Pythona do OpenCV. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %build install -d build @@ -173,6 +178,7 @@ cd build %{?with_tbb:-DWITH_TBB=ON} \ %{?with_unicap:-DWITH_UNICAP=ON} \ %{!?with_v4l:-DWITH_V4L=OFF} \ + %{?with_ximea:-DWITH_XIMEA=ON} \ %{?with_xine:-DWITH_XINE=ON} %{__make} -- 2.43.0