[Digikam-devel] [Bug 251391] OpenCV not detected during configuration

Gilles Caulier caulier.gilles at gmail.com
Thu Sep 16 07:39:09 BST 2010


https://bugs.kde.org/show_bug.cgi?id=251391


Gilles Caulier <caulier.gilles at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |caulier.gilles at gmail.com




--- Comment #1 from Gilles Caulier <caulier gilles gmail com>  2010-09-16 08:39:07 ---
I cannot confirm this under Mandriva 2010.1.

Opencv 2.1.0 package install a config file which will be used by Cmake to get
settings :

[gilles at localhost opencv]$ pwd
/usr/share/opencv
[gilles at localhost opencv]$ ls
haarcascades/  lbpcascades/  OpenCVConfig.cmake  samples/
[gilles at localhost opencv]$ cat OpenCVConfig.cmake
#
===================================================================================
#  The OpenCV CMake configuration file
#
#             ** File generated automatically, do not modify **
#
#  Usage from an external project: 
#    In your CMakeLists.txt, add these lines:
#
#    FIND_PACKAGE(OpenCV REQUIRED )
#    TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${OpenCV_LIBS})   
#
#    This file will define the following variables:
#      - OpenCV_LIBS          : The list of libraries to links against.
#      - OpenCV_LIB_DIR       : The directory where lib files are. Calling
LINK_DIRECTORIES
#                                with this path is NOT needed.
#      - OpenCV_INCLUDE_DIRS  : The OpenCV include directories.
#      - OpenCV_VERSION       : The  version of this OpenCV build. Example:
"1.2.0"
#      - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION. Example:
"1"
#      - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION. Example:
"2"
#      - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION. Example:
"0"
#
#
===================================================================================


# Extract the directory where *this* file has been installed (determined at
cmake run-time)
#  This variable may or may not be used below, depending on the parsing of
OpenCVConfig.cmake
get_filename_component(THIS_OPENCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}"
PATH)

# ======================================================
# Include directories to add to the user project:
# ======================================================
INCLUDE_DIRECTORIES(/usr/include/opencv)
# Provide the include directories to the caller
SET(OpenCV_INCLUDE_DIRS /usr/include/opencv)

# ======================================================
# Link directories to add to the user project:
# ======================================================
LINK_DIRECTORIES("/usr/lib")
# Provide the libs directory anyway, it may be needed in some cases.
SET(OpenCV_LIB_DIR "/usr/lib")

# ====================================================================
# Link libraries: e.g.   cxcore110.so, cv110.lib / cv110d.lib, etc...
# ====================================================================
set(OPENCV_LIB_COMPONENTS cxcore cv ml highgui cvaux)
SET(OpenCV_LIBS "")
foreach(__CVLIB ${OPENCV_LIB_COMPONENTS})
        # CMake>=2.6 supports the notation "debug XXd optimized XX"
        if (CMAKE_MAJOR_VERSION GREATER 2  OR  CMAKE_MINOR_VERSION GREATER 4)
                # Modern CMake:
                SET(OpenCV_LIBS ${OpenCV_LIBS} debug ${__CVLIB} optimized
${__CVLIB})
        else(CMAKE_MAJOR_VERSION GREATER 2  OR  CMAKE_MINOR_VERSION GREATER 4)
                # Old CMake:
                SET(OpenCV_LIBS ${OpenCV_LIBS} ${__CVLIB})
        endif(CMAKE_MAJOR_VERSION GREATER 2  OR  CMAKE_MINOR_VERSION GREATER 4)
endforeach(__CVLIB)

# For OpenCV built as static libs, we need the user to link against 
#  many more dependencies:
IF (NOT 1)
        # Under static libs, the user of OpenCV needs access to the 3rdparty
libs as well:
       
LINK_DIRECTORIES("/home/mandrake/rpm/BUILD/OpenCV-2.1.0/build/3rdparty/lib")

        SET(OpenCV_LIBS 
                dl;m;pthread;rt 

                /usr/lib/libjpeg.so 
                /usr/lib/libpng.so;/usr/lib/libz.so 
                /usr/lib/libtiff.so 
                /usr/lib/libjasper.so;/usr/lib/libjpeg.so 
               
gtk-x11-2.0;gdk-x11-2.0;atk-1.0;gio-2.0;pangoft2-1.0;gdk_pixbuf-2.0;pangocairo-1.0;cairo;pango-1.0;freetype;fontconfig;gobject-2.0;gmodule-2.0;gthread-2.0;rt;glib-2.0;gthread-2.0;rt;glib-2.0;gstbase-0.10;gstreamer-0.10;gobject-2.0;gmodule-2.0;xml2;gthread-2.0;rt;glib-2.0;avcodec;avformat;avutil;swscale;dc1394;v4l1;v4l2 
                ${OpenCV_LIBS}) # The standard libs BEFORE (OpenCV_LIBS) since
these can have "debug","optimized".
ENDIF(NOT 1)


# ======================================================
#  Version variables: 
# ======================================================
SET(OpenCV_VERSION 2.1.0)
SET(OpenCV_VERSION_MAJOR  2)
SET(OpenCV_VERSION_MINOR  1)
SET(OpenCV_VERSION_PATCH  0)

Sound like CMake cannot find this file, because environnement variable are not
set by OpenCV package on your computer. On my computer i can see that :

[gilles at localhost opencv]$ export |grep open
declare -x PWD="/usr/share/opencv"

Gilles Caulier

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list