I was also fooled by that sentence some time ago, but careful reading of what the doc says after "If NO_DEFAULT_PATH is not specified, the search process is
as follows:" suggests something different.<br><br>What I currently do to solve the issue of nonstandard package locations is to use an environment variable called Foo_ROOT_DIR (for package Foo), as suggested <a href="http://www.cmake.org/Wiki/CMake:Improving_Find*_Modules#Packages_in_unusual_locations">here</a>. If you're interested, I could send you a FindOpenCV.cmake script that works like this.<br>
<br>Cheers,<br><br>Adolfo<br><br><div class="gmail_quote">On Mon, Mar 9, 2009 at 11:19 AM, Benoit RAT (Gmail) <span dir="ltr"><<a href="mailto:benoit.rat@gmail.com">benoit.rat@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;">
Thanks Adolfo... but it's kind of strange behavior ....<br>I thought that i will first look in my specific path and then in the default path as it say in the doc: <br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
<i>The default search order is designed to be most-specific to least-specific for common use cases.<br></i></blockquote><div class="im"><br><br><br><br><br><br clear="all"><br>--<br>Benoit RAT<br><a href="http://www.neub.co.nr" target="_blank">www.neub.co.nr</a><br>
<br><br></div><div><div></div><div class="h5"><div class="gmail_quote">On Mon, Mar 9, 2009 at 10:57 AM, Adolfo Rodríguez <span dir="ltr"><<a href="mailto:dofo79@gmail.com" target="_blank">dofo79@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;">
Hi Benoit,<br><br>The documentation of <a href="http://www.cmake.org/cmake/help/cmake2.6docs.html#command:find_path" target="_blank">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.<div><div>
</div><div><br><br>
On Mon, Mar 9, 2009 at 10:40 AM, Benoit <span dir="ltr"><<a href="mailto:benpaka.spam@gmail.com" target="_blank">benpaka.spam@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div>
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></div></div>_______________________________________________<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><font color="#888888"><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" target="_blank">http://www.pal-robotics.com</a><br>Tel. +34.93.414.53.47<br>Fax.+34.93.209.11.09<br>
</font></blockquote></div><br>
</div></div></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>