[CMake] CMake + OpenCV + Visial Studio 2005 (V8)

Philip Lowman philip at yhbt.com
Fri Feb 29 15:23:30 EST 2008


On Fri, Feb 29, 2008 at 2:59 PM, Dario Figueira <wurmdario at gmail.com> wrote:

> In the CMakeLists: FIND_PACKAGE(OPENCV REQUIRED)
>
> CMake runs smoothly, but when VS tries to compile, it can't find by itself
> where, for instance, cv.h is
> By manually adding to VS VC++ include directories where the OpenCV
> includes are (which CMake knows, for instance, in the OPENCV_
> INCLUDE_DIR_CV variable, that is well filled automaticly by CMake), things
> work.
>
> I was wondering if this manual step could be avoided, am i missing
> something?


Dario,

When FIND_PACKAGE(OPENCV REQUIRED) is called that should invoke the
FindOPENCV.cmake file which I'm assuming is somewhere in your source tree.
This file will attempt to find the OPENCV include path (i.e. where it's
header files are) and perhaps other things (not sure what OPENCV is, so I
can't speculate).

If after configuring with CMakeSetup you see an OPENCV_INCLUDE_DIR_CV
variable in the cache that likely needs to be pointed to where the cv.h file
is.  Assuming that that variable is being pointed to the proper location of
where OPENCV is, you'll need to make sure that somewhere in the
CMakeLists.txt file after the FIND_PACKAGE(OPENCV REQUIRED) line that you
call:

INCLUDE_DIRECTORIES(${OPENCV_INCLUDE_DIR_CV})

(This assumes that you're OK with adding OPENCV to your include path for all
of your targets)



-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20080229/c6fd75a4/attachment.htm


More information about the CMake mailing list