Hi Benoit,<br><br>The documentation of <a href="http://www.cmake.org/cmake/help/cmake2.6docs.html#command:find_path">find_path</a> specifies the order in which paths are searched. If you want to force the /opt path to be searched first, you should maybe try<br>
<pre>find_path(<VAR> NAMES name PATHS ${NONSTANDARD_PATHS} NO_DEFAULT_PATH)<br>find_path(<VAR> NAMES name)<br></pre><div class="gmail_quote">This part is documented at the very end of the find_path doc.<br><br>
On Mon, Mar 9, 2009 at 10:40 AM, Benoit <span dir="ltr"><<a href="mailto:benpaka.spam@gmail.com">benpaka.spam@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>I'm having some trouble to use a cmake script correctly and i don't know why.<br>The cmake script come from the openCV library (you can find it here: <a href="http://opencv.willowgarage.com/wiki/Getting_started?action=AttachFile&do=get&target=FindOpenCV.cmake" target="_blank">http://opencv.willowgarage.com/wiki/Getting_started?action=AttachFile&do=get&target=FindOpenCV.cmake</a>) and it search for include and library files.<br>
<br>In this script you can setup the path where you want to look for these files, (or let the script search the default path).<br>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.<br>
<br>Here you have the important part of the script: <br><br>----------------------------------------------------- <br><br>MESSAGE(STATUS "OpenCV_POSSIBLE_ROOT_DIRS=${OpenCV_POSSIBLE_ROOT_DIRS}")
<br> <br>FIND_PATH(OpenCV_ROOT_DIR
<br> NAMES
<br> cv/include/cv.h # windows
<br> include/opencv/cv.h # linux /opt/net
<br> include/cv/cv.h
<br> include/cv.h
<br> PATHS ${OpenCV_POSSIBLE_ROOT_DIRS})<br> <br>MESSAGE(STATUS "Selected OpenCV_ROOT_DIR=${OpenCV_ROOT_DIR}")
<br><br>SET(OpenCV_INCDIR_SUFFIXES
<br> include
<br> include/cv
<br> include/opencv
<br> cv/include
<br> cxcore/include
<br> cvaux/include
<br> otherlibs/cvcam/include
<br> otherlibs/highgui
<br> otherlibs/highgui/include
<br> otherlibs/_graphics/include
<br> )
<br><br> <br>MESSAGE(STATUS "OpenCV_HIGHGUI_INCLUDE_DIR=${OpenCV_HIGHGUI_INCLUDE_DIR} ; root=${OpenCV_ROOT_DIR}")<br><br>FIND_PATH(OpenCV_HIGHGUI_INCLUDE_DIR
<br> NAMES highgui.h
<br> PATHS ${OpenCV_ROOT_DIR}
<br> PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )<br><br> MESSAGE(STATUS "OpenCV_HIGHGUI_INCLUDE_DIR=${OpenCV_HIGHGUI_INCLUDE_DIR} ${OpenCV_ROOT_DIR}")<br><br>-----------------------------------------------------<br>
<br><br>And here you have the first execution of cmake script when the cache empty.<br><br>
<p style="margin: 0px; text-indent: 0px;">OpenCV_POSSIBLE_ROOT_DIRS=/opt/opencv/1.1.0;usr/local;/usr;</p>
<p style="margin: 0px; text-indent: 0px;">Selected OpenCV_ROOT_DIR=/opt/opencv/1.1.0</p>
<p style="margin: 0px; text-indent: 0px;">OpenCV_HIGHGUI_INCLUDE_DIR= ; root=/opt/opencv/1.1.0</p>
<p style="margin: 0px; text-indent: 0px;">OpenCV_HIGHGUI_INCLUDE_DIR=/usr/include/opencv ; root=/opt/opencv/1.1.0</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">
<br></p>-----------------------------------------------------<br>
<br>Does anyone know why the result of OpenCV_HIGHGUI_INCLUDE_DIR=/usr/include/opencv and not /opt/opencv/1.1.0/include/opencv <br>even if both files /opt/opencv/1.1.0/include/opencv/highgui.h and/usr/include/opencv/highgui.h exist in my path.<br>
<font color="#888888">
<br><br clear="all"><br>--<br>Benoit RAT<br><a href="http://www.neub.co.nr" target="_blank">www.neub.co.nr</a><br>
</font><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br><br clear="all"><br>-- <br>Adolfo Rodríguez Tsouroukdissian<br><br>Robotics engineer<br>
PAL ROBOTICS S.L<br><a href="http://www.pal-robotics.com">http://www.pal-robotics.com</a><br>Tel. +34.93.414.53.47<br>Fax.+34.93.209.11.09<br>