[CMake] Using different installs/versions of the OpenCV library

Bart Vandewoestyne Bart.Vandewoestyne at telenet.be
Thu Feb 14 06:09:16 EST 2013


On 02/14/2013 11:47 AM, Andreas Haferburg wrote:
> Have you tried specifying the version?
>
> FIND_PACKAGE(OpenCV 2.2.0 EXACT REQUIRED)
>
> FIND_PACKAGE(OpenCV 2.4.0 EXACT REQUIRED)
>
> Not sure if the FindOpenCV script can handle the version argument.
>
> Andreas

Doesn't seem to work.  I have 2.4.3 installed under /tmp/opencv_install 
and I now used

   find_package( OpenCV 2.4.3 EXACT REQUIRED )

in my CMakeLists.txt, but I get:


CMake Error at CMakeLists.txt:7 (find_package):
   Could not find a configuration file for package "OpenCV" that exactly
   matches requested version "2.4.3".

   The following configuration files were considered but not accepted:

     /usr/share/OpenCV/OpenCVConfig.cmake, version: 2.3.1



-- Configuring incomplete, errors occurred!


Any other suggestions?  It would really be nice for me to be able to 
easily switch between different OpenCV installs...

Regards,
Bart


More information about the CMake mailing list