aha. <br>Thanks <div>The command <br><div style>find_library(PCRE_LIBRARY pcre</div><div style>PATHS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib</div><div style>)</div><div style>is working perfectly issue was that it was reading the variable value from the cache after deleting cache it is finding library at {CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib</div>
<div style><br></div><div style><br></div>regards<div>Vivek Goel</div><br>
<br><br><div class="gmail_quote">On Thu, Jun 7, 2012 at 12:12 AM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Please cc the list so others may benefit from the discussion.</div><div><br></div>Then you need two find_library calls. One to find it in your custom directory with NO_DEFAULT_PATH, and then if it's not there, the same call again without the NO_DEFAULT_PATH.<div>
<br></div><div><br></div><div>HTH,</div><div>David</div><div class="HOEnZb"><div class="h5"><div><br><br><div class="gmail_quote">On Wed, Jun 6, 2012 at 2:25 PM, vivek goel <span dir="ltr"><<a href="mailto:goelvivek2011@gmail.com" target="_blank">goelvivek2011@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">on some system library will be there at given path and on some system it will not. <div><br>The reason for which I want use find_library is that:<div>
If library file is there at given location use it </div><div>otherwise use system library. </div>
<div><br></div><div>Which can't be possible by hard coding the path. </div><div><br></div><div><br clear="all">regards<span><font color="#888888"><div>Vivek Goel</div></font></span><div><div>
<br>
<br><br><div class="gmail_quote">On Wed, Jun 6, 2012 at 11:51 PM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Try reading the documentation and using the "<span style="font-family:monospace;font-size:11px;line-height:22px;white-space:pre-wrap">NO_DEFAULT_PATH</span>" keyword if you don't want to look in the default places.<div>
<br></div><div>On the other hand, if you know exactly where the library is, why are you doing a find_library operation? Why not simply set the variable to the value you know?<br><br></div><div><div>
<div><br><div class="gmail_quote">
On Wed, Jun 6, 2012 at 1:36 PM, vivek goel <span dir="ltr"><<a href="mailto:goelvivek2011@gmail.com" target="_blank">goelvivek2011@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br clear="all">regards<div>Vivek Goel</div><br>
<br><br><div class="gmail_quote"><div>On Wed, Jun 6, 2012 at 11:05 PM, vivek goel <span dir="ltr"><<a href="mailto:goelvivek2011@gmail.com" target="_blank">goelvivek2011@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
sorry for typo it was path. <br></blockquote></div><div>path=paths :) </div><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">but still it doesn't work <div>
<div>find_library(PCRE_LIBRARY pcre</div>
<div>HINTS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib</div><div>PATHS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib</div>
<div>)</div><div><br></div><div>again output is /usr/lib/x86_64-linux-gnu/libpcre.so</div><div><br></div>regards<span><font color="#888888"><div>Vivek Goel</div></font></span><div><div><br>
<br><br><div class="gmail_quote">On Wed, Jun 6, 2012 at 10:52 PM, Andreas Pakulat <span dir="ltr"><<a href="mailto:apaku@gmx.de" target="_blank">apaku@gmx.de</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><div class="gmail_quote"><div><div>On Wed, Jun 6, 2012 at 5:40 PM, vivek goel <span dir="ltr"><<a href="mailto:goelvivek2011@gmail.com" target="_blank">goelvivek2011@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am using following command to find pcre library <br><br>SET(CMAKE_LIBRARY_PATH "${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib")<br>All compiled library are located in ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib<br>
<br>find_library(PCRE_LIBRARY <br>pcre<br>PATH <br>${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib}<br><br>But every-time it is searching at /usr/lib/x86_64-linux-gnu/libpcre.so. How can I change order for library search path ?<br>
</blockquote><div><br></div></div></div><div>See the documentation for the function:</div><div><a href="http://cmake.org/cmake/help/v2.8.8/cmake.html#command:find_library" target="_blank">http://cmake.org/cmake/help/v2.8.8/cmake.html#command:find_library</a></div>
<div><br></div><div>As you can see 'PATH' is an unknown parameter for the function anyway. You probably want to provide HINTS. The exact logic of finding the libraries is explained there too.</div><div><br></div>
<div>
Andreas</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><br><br><br clear="all">regards<span><font color="#888888"><div>Vivek Goel</div>
<br><span><font color="#888888">
</font></span></font></span><span><font color="#888888"><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></font></span></blockquote></div><br>
</blockquote></div><br></div></div></div>
</blockquote></div></div></div><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></div>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>