[CMake] problem with cmake script.

Adolfo Rodríguez dofo79 at gmail.com
Mon Mar 9 05:57:01 EDT 2009


Hi Benoit,

The documentation of
find_path<http://www.cmake.org/cmake/help/cmake2.6docs.html#command:find_path>specifies
the order in which paths are searched. If you want to force the
/opt path to be searched first, you should maybe try

find_path(<VAR> NAMES name PATHS ${NONSTANDARD_PATHS} NO_DEFAULT_PATH)
find_path(<VAR> NAMES name)

This part is documented at the very end of the find_path doc.

On Mon, Mar 9, 2009 at 10:40 AM, Benoit <benpaka.spam at gmail.com> wrote:

> Hello,
>
> I'm having some trouble to use a cmake script correctly and i don't know
> why.
> The cmake script come from the openCV library (you can find it here:
> http://opencv.willowgarage.com/wiki/Getting_started?action=AttachFile&do=get&target=FindOpenCV.cmake)
> and it search for include and library files.
>
> In this script you can setup the path where you want to look for these
> files, (or let the script search the default path).
> The problem is that if i have to version of openCV (one in the default path
> and one in a special path), it alway select me the default path.
>
> Here you have the important part of the script:
>
> -----------------------------------------------------
>
> MESSAGE(STATUS "OpenCV_POSSIBLE_ROOT_DIRS=${OpenCV_POSSIBLE_ROOT_DIRS}")
>
> FIND_PATH(OpenCV_ROOT_DIR
>   NAMES
>   cv/include/cv.h     # windows
>   include/opencv/cv.h # linux /opt/net
>   include/cv/cv.h
>   include/cv.h
>   PATHS ${OpenCV_POSSIBLE_ROOT_DIRS})
>
> MESSAGE(STATUS "Selected OpenCV_ROOT_DIR=${OpenCV_ROOT_DIR}")
>
> SET(OpenCV_INCDIR_SUFFIXES
>   include
>   include/cv
>   include/opencv
>   cv/include
>   cxcore/include
>   cvaux/include
>   otherlibs/cvcam/include
>   otherlibs/highgui
>   otherlibs/highgui/include
>   otherlibs/_graphics/include
>   )
>
>
> MESSAGE(STATUS "OpenCV_HIGHGUI_INCLUDE_DIR=${OpenCV_HIGHGUI_INCLUDE_DIR} ;
> root=${OpenCV_ROOT_DIR}")
>
> FIND_PATH(OpenCV_HIGHGUI_INCLUDE_DIR
>   NAMES highgui.h
>   PATHS ${OpenCV_ROOT_DIR}
>   PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
>
>  MESSAGE(STATUS "OpenCV_HIGHGUI_INCLUDE_DIR=${OpenCV_HIGHGUI_INCLUDE_DIR}
> ${OpenCV_ROOT_DIR}")
>
> -----------------------------------------------------
>
>
> And here you have the first execution of cmake script when the cache empty.
>
> OpenCV_POSSIBLE_ROOT_DIRS=/opt/opencv/1.1.0;usr/local;/usr;
>
> Selected OpenCV_ROOT_DIR=/opt/opencv/1.1.0
>
> OpenCV_HIGHGUI_INCLUDE_DIR= ; root=/opt/opencv/1.1.0
>
> OpenCV_HIGHGUI_INCLUDE_DIR=/usr/include/opencv ; root=/opt/opencv/1.1.0
>
>
>
>
> -----------------------------------------------------
>
> Does anyone know why the result of
> OpenCV_HIGHGUI_INCLUDE_DIR=/usr/include/opencv and not
> /opt/opencv/1.1.0/include/opencv
> even if both files /opt/opencv/1.1.0/include/opencv/highgui.h
> and/usr/include/opencv/highgui.h  exist in my path.
>
>
>
> --
> Benoit RAT
> www.neub.co.nr
>
> _______________________________________________
> 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

Robotics engineer
PAL ROBOTICS S.L
http://www.pal-robotics.com
Tel. +34.93.414.53.47
Fax.+34.93.209.11.09
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090309/812a761d/attachment.htm>


More information about the CMake mailing list