From 55567582a680d6445f400facd37febbebeffec8f Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Tue, 26 Jun 2012 11:48:58 +0000 Subject: [PATCH] added XIMEA support for linux (by Igor Kuzmin) #2085 --- CMakeLists.txt | 14 +++++++------- cmake/OpenCVFindXimea.cmake | 13 ++++++++++--- modules/highgui/CMakeLists.txt | 4 +++- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c6f8a1c5..8f4eebe0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,14 +116,14 @@ OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" ON OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) ) OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON) OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS) ) -OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT IOS) ) -OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT IOS) ) +OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) ) +OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_IMAGEIO "ImageIO support for OS X" OFF IF APPLE) OCV_OPTION(WITH_IPP "Include Intel IPP support" OFF IF (MSVC OR X86 OR X86_64) ) OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) ) OCV_OPTION(WITH_JPEG "Include JPEG support" ON IF (NOT IOS) ) OCV_OPTION(WITH_OPENEXR "Include ILM support via OpenEXR" ON IF (NOT IOS) ) -OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID AND NOT IOS AND NOT APPLE) ) +OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID AND NOT APPLE) ) OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS) ) OCV_OPTION(WITH_PNG "Include PNG support" ON IF (NOT IOS) ) OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS) ) @@ -131,11 +131,11 @@ OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF IF APPLE ) OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS) ) OCV_OPTION(WITH_TIFF "Include TIFF support" ON IF (NOT IOS) ) -OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT IOS) ) -OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT IOS) ) +OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) ) +OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_VIDEOINPUT "Build HighGUI with DirectShow support" ON IF WIN32 ) -OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF WIN32 ) -OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT IOS) ) +OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT APPLE) ) +OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_CLP "Include Clp support (EPL)" OFF) # OpenCV build components diff --git a/cmake/OpenCVFindXimea.cmake b/cmake/OpenCVFindXimea.cmake index 7528956fe..5600275f4 100755 --- a/cmake/OpenCVFindXimea.cmake +++ b/cmake/OpenCVFindXimea.cmake @@ -8,6 +8,7 @@ # XIMEA_LIBRARY_DIR - XIMEA libraries folder # # Created: 5 Aug 2011 by Marian Zajko (marian.zajko@ximea.com) +# Updated: 25 June 2012 by Igor Kuzmin (parafin@ximea.com) # set(XIMEA_FOUND) @@ -20,10 +21,16 @@ if(WIN32) if(EXISTS XIMEA_PATH) set(XIMEA_FOUND 1) - # set LIB folders - set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}\\x86") - + set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}/x86") + else() + set(XIMEA_FOUND 0) + endif() +else() + if(EXISTS /opt/XIMEA) + set(XIMEA_FOUND 1) + # set folders + set(XIMEA_PATH /opt/XIMEA/include) else() set(XIMEA_FOUND 0) endif() diff --git a/modules/highgui/CMakeLists.txt b/modules/highgui/CMakeLists.txt index 4e214219d..210298237 100644 --- a/modules/highgui/CMakeLists.txt +++ b/modules/highgui/CMakeLists.txt @@ -150,7 +150,9 @@ endif(HAVE_opencv_androidcamera) if(HAVE_XIMEA) list(APPEND highgui_srcs src/cap_ximea.cpp) ocv_include_directories(${XIMEA_PATH}) - link_directories(${XIMEA_LIBRARY_DIR}) + if(XIMEA_LIBRARY_DIR) + link_directories(${XIMEA_LIBRARY_DIR}) + endif() list(APPEND HIGHGUI_LIBRARIES m3api) endif(HAVE_XIMEA)