<div dir="ltr"><div><div><div>Hi Mojca,<br><br></div>From what I know cmake will look for libraries in the directories specified in link_directories(${LIBRARY_DIRS}) and for headers in the directories specified in include_directories(${INCLUDE_DIRS}) and the property INCLUDE_DIRECTORIES. <br>
<br><a href="http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:link_directories">http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:link_directories</a><br><br><a href="http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:include_directories">http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:include_directories</a><br>
<br></div>Cheers!<br></div>Angeliki<br><br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 26, 2014 at 10:56 PM, Mojca Miklavec <span dir="ltr"><<a href="mailto:mojca@macports.org" target="_blank">mojca@macports.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
In our package manager where it is of crucial importance to link<br>
against the proper library we often end up with hardcoding lots and<br>
lots of options, like:<br>
<br>
-DOPENGL_INCLUDE_DIR=${prefix}/include \<br>
-DX11_ICE_INCLUDE_PATH=${prefix}/include \<br>
-DX11_SM_INCLUDE_PATH=${prefix}/include \<br>
-DX11_X11_INCLUDE_PATH=${prefix}/include \<br>
-DX11_Xext_INCLUDE_PATH=${prefix}/include \<br>
-DX11_Xft_INCLUDE_PATH=${prefix}/include \<br>
-DX11_Xpm_INCLUDE_PATH=${prefix}/include \<br>
-DX11_ICE_LIB=${prefix}/lib/libICE.dylib \<br>
-DX11_SM_LIB=${prefix}/lib/libSM.dylib \<br>
-DX11_X11_LIB=${prefix}/lib/libX11.dylib \<br>
-DX11_Xext_LIB=${prefix}/lib/libXext.dylib \<br>
-DX11_Xft_LIB=${prefix}/lib/libXft.dylib \<br>
-DX11_Xpm_LIB=${prefix}/lib/libXpm.dylib \<br>
-DOPENGL_gl_LIBRARY=${prefix}/lib/libGL.dylib \<br>
<br>
With autotools that usually boiled down to just:<br>
    --with-x=${prefix}<br>
<br>
My question: is there any way to tell CMake the following?<br>
<br>
"Please don't search for any libraries or headers from /sw or /usr/X11<br>
or /opt/local or anything, I really really want you to search for the<br>
libraries in /my/special/prefix and only there".<br>
<br>
A while back a user asked for removing /sw from CMake Find<Foo><br>
modules because that caused him problems. But I would like to<br>
understand the general policy about this.<br>
<br>
See:<br>
    <a href="https://trac.macports.org/ticket/41817" target="_blank">https://trac.macports.org/ticket/41817</a><br>
<br>
I like that fact that CMake eventually offers more flexibility, but it<br>
makes it a bit painful to ensure that exactly the right libraries are<br>
used. I'm sure that I'm missing something though, so I would like to<br>
understand how to handle this properly.<br>
<br>
Thank you,<br>
    Mojca<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" 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" target="_blank">http://www.cmake.org/Wiki/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" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>