<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Courier New";
        panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:595.0pt 842.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">The problem is on NAMES argument. You have to specify library names without prefix. So
<b>Clp</b> must be used rather than <b>libClp</b>.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">FIND_LIBRARY(CLP_LIBRARY       NAMES
<span style="color:red">Clp</span>       PATHS ${CLP_LIB} NO_DEFAULT_PATH)<br>
<br>
</span><span style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">CMake <cmake-bounces@cmake.org> on behalf of "cornelis@bockemuehl.ch" <cornelis@bockemuehl.ch><br>
<b>Date: </b>Thursday 9 November 2017 at 00:09<br>
<b>To: </b>"cmake@cmake.org" <cmake@cmake.org><br>
<b>Subject: </b>[CMake] find_library not finding libraries - why?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p>In a CMakeLists.txt I have the following lines of code:<br>
<br>
<span style="font-family:"Courier New",serif;color:turquoise"># with this the user will be asked for a path that has then<br>
# lib64 other subdirectories that are specified below</span><span style="font-family:"Courier New",serif"><br>
<strong><span style="font-family:"Courier New",serif;color:mediumblue">FIND_PATH(CLP_DIR libClp)</span></strong><b><span style="color:mediumblue"><br>
<br>
<strong><span style="font-family:"Courier New",serif">SET(CLP_LIB ${CLP_DIR}/lib64)</span></strong></span></b><br>
<br>
<span style="color:turquoise"># after the user specified CLP_DIR this shows what is expected:<br>
# the full path to the libraries, but...</span><br>
<strong><span style="font-family:"Courier New",serif;color:mediumblue">message(AUTHOR_WARNING ${CLP_LIB})</span></strong><br>
<br>
<span style="color:turquoise"># with the following I think I cannot indicate more clearly where the libraries actually are:</span><br>
<strong><span style="font-family:"Courier New",serif;color:mediumblue">FIND_LIBRARY(CLP_LIBRARY       NAMES libClp       PATHS ${CLP_LIB} NO_DEFAULT_PATH)</span></strong><b><span style="color:mediumblue"><br>
<strong><span style="font-family:"Courier New",serif">FIND_LIBRARY(COINUTILS_LIBRARY NAMES libCoinUtils PATHS ${CLP_LIB} NO_DEFAULT_PATH)</span></strong><br>
<strong><span style="font-family:"Courier New",serif">FIND_LIBRARY(OSI_LIBRARY       NAMES libOsi       PATHS ${CLP_LIB} NO_DEFAULT_PATH)</span></strong><br>
<strong><span style="font-family:"Courier New",serif">FIND_LIBRARY(OSICLP_LIBRARY    NAMES libOsiClp    PATHS ${CLP_LIB} NO_DEFAULT_PATH)</span></strong></span></b><br>
<br>
<span style="color:turquoise"># ...here everything comes as -NOTFOUND</span><br>
<strong><span style="font-family:"Courier New",serif;color:mediumblue">message(AUTHOR_WARNING ${CLP_LIBRARY})</span></strong><br>
<strong><span style="font-family:"Courier New",serif;color:mediumblue">message(AUTHOR_WARNING ${COINUTILS_LIBRARY})</span></strong><b><span style="color:mediumblue"><br>
<strong><span style="font-family:"Courier New",serif">message(AUTHOR_WARNING ${OSI_LIBRARY})</span></strong><br>
<strong><span style="font-family:"Courier New",serif">message(AUTHOR_WARNING ${OSICLP_LIBRARY})</span></strong></span></b></span><br>
<br>
A dir for the indicated directory shows the following files:<br>
<br>
<span style="font-family:"Courier New",serif;color:brown">-rwxrwxrwx 1 cornelis users     907  8. Nov 18:37 libClp.la<br>
lrwxrwxrwx 1 cornelis users      42  8. Nov 18:37 libClp.so -> libClp.so.1.13.11<br>
lrwxrwxrwx 1 cornelis users      42  8. Nov 18:37 libClp.so.1 -> libClp.so.1.13.11<br>
-rwxrwxrwx 1 cornelis users 1887336  8. Nov 18:37 libClp.so.1.13.11<br>
-rwxrwxrwx 1 cornelis users    1010  8. Nov 18:37 libClpSolver.la<br>
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libClpSolver.so -> libClpSolver.so.1.13.11<br>
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libClpSolver.so.1 -> libClpSolver.so.1.13.11<br>
-rwxrwxrwx 1 cornelis users  415224  8. Nov 18:37 libClpSolver.so.1.13.11<br>
-rwxrwxrwx 1 cornelis users     870  8. Nov 18:37 libCoinUtils.la<br>
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libCoinUtils.so -> libCoinUtils.so.3.10.14<br>
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libCoinUtils.so.3 -> libCoinUtils.so.3.10.14<br>
-rwxrwxrwx 1 cornelis users 1416632  8. Nov 18:37 libCoinUtils.so.3.10.14<br>
-rwxrwxrwx 1 cornelis users    1059  8. Nov 18:37 libOsiClp.la<br>
lrwxrwxrwx 1 cornelis users      48  8. Nov 18:37 libOsiClp.so -> libOsiClp.so.1.13.11<br>
lrwxrwxrwx 1 cornelis users      48  8. Nov 18:37 libOsiClp.so.1 -> libOsiClp.so.1.13.11<br>
-rwxrwxrwx 1 cornelis users  350080  8. Nov 18:37 libOsiClp.so.1.13.11<br>
-rwxrwxrwx 1 cornelis users    1038  8. Nov 18:37 libOsiCommonTests.la<br>
lrwxrwxrwx 1 cornelis users      62  8. Nov 18:37 libOsiCommonTests.so -> libOsiCommonTests.so.1.12.9<br>
lrwxrwxrwx 1 cornelis users      62  8. Nov 18:37 libOsiCommonTests.so.1 -> libOsiCommonTests.so.1.12.9<br>
-rwxrwxrwx 1 cornelis users  619392  8. Nov 18:37 libOsiCommonTests.so.1.12.9<br>
-rwxrwxrwx 1 cornelis users     905  8. Nov 18:37 libOsi.la<br>
lrwxrwxrwx 1 cornelis users      40  8. Nov 18:37 libOsi.so -> libOsi.so.1.12.9<br>
lrwxrwxrwx 1 cornelis users      40  8. Nov 18:37 libOsi.so.1 -> libOsi.so.1.12.9<br>
-rwxrwxrwx 1 cornelis users  400776  8. Nov 18:37 libOsi.so.1.12.9<br>
drwxrwxrwx 1 cornelis users    4096  8. Nov 18:37 pkgconfig</span><br>
<br>
so the libraries are obviously there!<br>
<br>
Questions:<br>
<strong><span style="font-family:"Calibri",sans-serif">What am I doing wrong?</span></strong><b><br>
<strong><span style="font-family:"Calibri",sans-serif">What did I possibly misunderstand regarding the find_library command?</span></strong></b><br>
<br>
Thanks for any helpful hints!<br>
Cornelis<o:p></o:p></p>
</div>
</body>
</html>