<div dir="ltr">Have you tried using CMAKE_PREFIX_PATH instead of CMAKE_INSTALL_PREFIX?</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 4, 2017 at 5:13 PM, Kris Thielemans <span dir="ltr"><<a href="mailto:kris.f.thielemans@gmail.com" target="_blank">kris.f.thielemans@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="#0563C1" vlink="#954F72"><div class="m_-3481910369666681682WordSection1"><p class="MsoNormal">Hi<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Short question: if we have a library/include files installed both in the usual system locations and outside, how do we force CMake to find the latter? (without modifying the CMake files of the project).<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Motivation:<u></u><u></u></p><p class="MsoNormal">We’re trying to make a SuperBuild that builds/downloads a specific version of various packages (such as Boost and GTest). Our motivation is to have complete control of the version. We don’t want to install this in standard locations to avoid clashes, root permissions etc.  So let’s say we install our versions in ~/our_stuff/lib, ~/our_stuff/include etc<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">It seems very hard (and sometimes impossible) however to let future find_packages find our own versions as opposed to the system ones. From <a href="https://cmake.org/cmake/help/latest/command/find_library.html" target="_blank">https://cmake.org/cmake/help/<wbr>latest/command/find_library.<wbr>html</a> I thought that doing something like this would work<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">cmake ../ -DCMAKE_INSTALL_PREFIX=~/our_<wbr>stuff<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">but the system version of boost etc are still found first (it does work if there is no system version of the library). In the case of Boost, even <u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">cmake ../ -DCMAKE_INSTALL_PREFIX=~/our_<wbr>stuff -DBOOST_ROOT=~/our_stuff<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">doesn’t help (tested on Linux). I have to set BOOST_INCLUDEDIR for instance. As every Find*.cmake has its own conventions of specifying cmake/environment variables, and some don’t at all, this just gets unfeasible.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I know about NO_DEFAULT_PATH, NO_CMAKE_SYSTEM_PATH etc options for find_package, but this would need modification of CMake files in the dependent packages which is quite undesirable for us.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Any suggestions?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></p><span class="HOEnZb"><font color="#888888"><p class="MsoNormal">Kris<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p></font></span></div></div><br>--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/cmake</a><br></blockquote></div><br></div>