You could try forcing the cache entry for the path to XXX_PATH-NOTFOUND (or unset(XXX_PATH CACHE)) and by using GET_FILENAME_COMPONENT() try to remove the path where the directory was found from a list that you're passing into the find_path() call. This probably wouldn't work for things specified in CMAKE_PREFIX_PATH or for anything in the standard system paths, however, so I'm very hesitant about suggesting the above at all.<br>
<br>Best practices for FindXXX probably should be not to try to recover from this error. Simply throw a very loud error to the user telling them that the headers found in XXX_INCLUDE_DIR are too old and tell the user to fix the problem (which he can do by modifying XXX_INCLUDE_DIR). You can also consider using XXX_INCLUDE_DIR/../lib as a hint for finding libraries.<br>
<br><div class="gmail_quote">On Wed, Jul 15, 2009 at 11:47 AM, joe <span dir="ltr"><<a href="mailto:loeffel77@yahoo.com">loeffel77@yahoo.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;">
<br>
Hi,<br>
I am currently writing a FindXXX.cmake file which uses find_path to find<br>
an include path. Unfortunately it turns out that there might be several versions of the file in the PATHs/HINTS (e.g. several revisions of the package). (I handle this with test using the try_compile command).<br>
<br>
My question is the following:<br>
If I determine that the path which cmake found with "find_path" is not the one, I am looking for (i.e. wrong version), is there a way to "continue" the find_path comment, to get the next match for a specific file? Alternatively is there a way to explicitly exclude a path (in my case the path of the first match) for the find_path command?<br>
<br>
Cheers, Klaus<br>
<br>
<br>
<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>Philip Lowman<br>