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

Andreas Haferburg ahaferburg at scopis.com
Thu Feb 14 06:26:47 EST 2013


Does CMake find 2.4.3 if you remove 2.3.1? CMake probably doesn't even look in /tmp/. You could try 
moving it to /usr/share/OpenCV-2.4.3/.

If the version arg doesn't work, I think your best bet is to use a naming convention for the library 
directories (or create symlinks), e.g. <lib>-<version>-<arch>, then use that directory in the find 
script.

Andreas



On 14.02.2013 12:09, Bart Vandewoestyne 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