<div class="gmail_quote">On Fri, Jan 30, 2009 at 3:44 AM, Adolfo Rodríguez <span dir="ltr"><<a href="mailto:dofo79@gmail.com">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;">
<div class="gmail_quote"><div><div></div><div class="Wj3C7c">On Fri, Jan 30, 2009 at 7:11 AM, Philip Lowman <span dir="ltr"><<a href="mailto:philip@yhbt.com" target="_blank">philip@yhbt.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;">
<div class="gmail_quote"><div>On Fri, Jan 30, 2009 at 12:08 AM, Tyler Roscoe <span dir="ltr"><<a href="mailto:tyler@cryptio.net" target="_blank">tyler@cryptio.net</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;">
This seems like a common situation, so surely there's a CMake way to<br>
handle it? I was hoping the PATHS parameter would do what I want but<br>
it's for specifying the path to the FindXXX modules.</blockquote></div><div><br>Read the documentation for the find_path() and find_library() commands. Setting the variable CMAKE_PREFIX_PATH (or environment variable) will likely be of tremendous help to you.<br>
</div></div></blockquote></div></div><div><br>I have a project with similar requirements as Tyler's, and we effectively use the CMAKE_PREFIX_PATH variable. The thing is that if you ONLY want the FindXXX.cmake to look in the paths pointed by CMAKE_PREFIX_PATH, and not the standard ones (e.g., /usr, /usr/local, ... on Unix), this might not be enough.<br>
FindBoost.cmake has a very convenient variable named Boost_ROOT that specifies where the boost libraries are located. Taking a quick look at the FindQt*.cmake doc, I didn't find a similar functionality, but I still wonder if it can be achieved in a simple way.</div>
</div></blockquote><div><br>Sorry to disappoint, but FindBoost suffers from the same issue in that setting Boost_ROOT doesn't guarantee you won't have libraries picked up in the system paths.<br><a href="http://public.kitware.com/Bug/view.php?id=8412">http://public.kitware.com/Bug/view.php?id=8412</a><br>
</div></div><br>Worse case, if you absolutely can't stand
finding stuff outside of X_ROOT perhaps you can obtain the path of
X_LIBRARY with GET_FILENAME_COMPONENT() and ensure it's within X_ROOT
through a regex or something, after you call FIND_PACKAGE()? I am considering such an approach with FindBoost to warn about detection of a Boost library in a system path when the Boost include dir is in Boost_ROOT.<br><br>
-- <br>Philip Lowman<br>