[CMake] FIND_PACKAGE does not work

Adolfo Rodríguez Tsouroukdissian dofo79 at gmail.com
Fri Dec 18 07:06:55 EST 2009


On Fri, Dec 18, 2009 at 12:57 PM, Müller Michael <
michael.mueller at dkfz-heidelberg.de> wrote:

> Hi all,
>
> i am trying to include OpenCV 2.0 (which is using CMake now) in our
> project. Therefore, I call FIND_PACKAGE(OpenCV 2 REQUIRED) in one of our
> CMake files with the following result:
>
> CMake Error at mitk/CMake/MITK_OpenCV_Config.cmake:2 (FIND_PACKAGE):
>  Could not find module FindOpenCV.cmake or a configuration file for package
>  OpenCV.
>
>  Adjust CMAKE_MODULE_PATH to find FindOpenCV.cmake or set OpenCV_DIR to the
>  directory containing a CMake configuration file for OpenCV.  The file will
>  have one of the following names:
>
>    OpenCVConfig.cmake
>    opencv-config.cmake
>
> ...
>
> The file OpenCVConfig.cmake exists and I provide an ENV variable OpenCV_DIR
> pointing to the correct dir which CMake should find. However, even if I set
> OpenCV_DIR manually in the cache, CMake keeps failing.
>
> Any ideas?
>

As the error message says, you should use  CMAKE_MODULE_PATH (and not
OpenCV_DIR) to specify the path where OpenCVConfig.cmake is located.
OpenCV_DIR is most probably used to specify where OpenCV is installed when a
nonstandard path is used.

HTH,

Adolfo


> Greets
> Michael
>
>
>
> _______________________________________________
> 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
>



-- 
Adolfo Rodríguez Tsouroukdissian, Ph. D.

Robotics engineer
PAL ROBOTICS S.L
http://www.pal-robotics.com
Tel. +34.93.414.53.47
Fax.+34.93.209.11.09
AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden
contener información privilegiada y/o confidencial que está dirigida
exclusivamente a su destinatario. Si usted recibe este mensaje y no es el
destinatario indicado, o el empleado encargado de su entrega a dicha
persona, por favor, notifíquelo inmediatamente y remita el mensaje original
a la dirección de correo electrónico indicada. Cualquier copia, uso o
distribución no autorizados de esta comunicación queda estrictamente
prohibida.

CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may
contain confidential information which is privileged and intended only for
the individual or entity to whom they are addressed.  If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution or use of this e-mail and/or accompanying document(s) is
strictly prohibited.  If you have received this e-mail in error, please
immediately notify the sender at the above e-mail address.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091218/aece1fd6/attachment-0001.htm>


More information about the CMake mailing list