[CMake] problem with cmake script.
Benoit
benpaka.spam at gmail.com
Mon Mar 9 05:40:40 EDT 2009
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090309/7c00b4c1/attachment.htm>
More information about the CMake
mailing list