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

Petr Kmoch petr.kmoch at gmail.com
Thu Feb 14 06:13:32 EST 2013


Hi Bart.

When you look into the documentation of find_package() (in its
Configure mode), you'll find a list of paths and prefixes the find
machanism uses. You should be able to set some of those prefixes to
where your local installation of OpenCV is.

Petr

On Thu, Feb 14, 2013 at 12:09 PM, Bart Vandewoestyne
<Bart.Vandewoestyne at telenet.be> wrote:
> 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
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list