<br><tt><font size=2>&quot;Yuri V. Timenkov&quot; &lt;ytimenkov@parallels.com&gt;
wrote on 08/19/2008 02:05:04 PM:<br>
<br>
&gt; Are following posts solve your problem?<br>
&gt; <br>
&gt; http://www.cmake.org/pipermail/cmake/2008-July/023099.html<br>
&gt; http://www.cmake.org/pipermail/cmake/2006-September/011100.html<br>
&gt; http://www.cmake.org/pipermail/cmake/2005-February/006080.html<br>
</font></tt>
<br><tt><font size=2>Yes they do. The tricky point was having to know that
the symbol ${LIBRARYNAME}_EXPORTS is set when building the library.</font></tt>
<br><tt><font size=2>Then adding something along these lines in the header
file solves the problem:</font></tt>
<br>
<br><tt><font size=2>#ifdef _WIN32</font></tt>
<br><tt><font size=2># &nbsp;ifdef testc2_EXPORTS</font></tt>
<br><tt><font size=2># &nbsp; &nbsp;define WHATEVER __declspec( dllexport
)</font></tt>
<br><tt><font size=2># &nbsp;else</font></tt>
<br><tt><font size=2># &nbsp; &nbsp;define WHATEVER __declspec( dllimport
)</font></tt>
<br><tt><font size=2># &nbsp;endif</font></tt>
<br><tt><font size=2>#else</font></tt>
<br><tt><font size=2># &nbsp;define WHATEVER &nbsp;</font></tt>
<br><tt><font size=2>#endif</font></tt>
<br>
<br><tt><font size=2>WHATEVER float LibC2Func();</font></tt>
<br>
<br><tt><font size=2>So now I can get a simple project with one dll and
one exe to compile, but I still do not understand which program determines
whether the .exe should link to a .lib or a .dll. Does the Microsoft Visual
Studio compiler determine this or does CMake inspect the header files?</font></tt>
<br><tt><font size=2>I find it strange that the linking command depends
on the contents of the header files. Is there a reason for this?</font></tt>
<br>
<br><tt><font size=2>Cheers,</font></tt>
<br><tt><font size=2>Jos</font></tt>
<br><font size=2 face="Verdana"><br>
 &nbsp;<br>
 &nbsp;<b><br>
Jos van den Oever </b>- SW Engineering <br>
 &nbsp;</font>
<table width=100%>
<tr valign=top>
<td width=32%><font size=1 face="Verdana">PANalytical <br>
Lelyweg 1 <br>
7602 EA Almelo <br>
The Netherlands </font>
<td width=67%><font size=1 face="Verdana">T &nbsp; +31 (0)546 528<br>
F &nbsp; +31 (0)546 534598<br>
Jos.van.den.Oever@panalytical.com<br>
www.PANalytical.com</font></table>
<br><font size=2 face="Verdana"><br>
</font>
<table width=100%>
<tr>
<td width=48% bgcolor=#ff8d40><font size=2 face="Verdana">&nbsp;</font><font size=2 color=white face="Verdana"><b>PANalytical</b></font>
<td width=51% bgcolor=#ff8d40>
<div align=right><font size=2 color=white face="Verdana"><b>The Analytical
X-ray Company </b></font><font size=3>&nbsp;</font></div>
<tr valign=top>
<td colspan=2><font size=1 color=#808080 face="Verdana"><br>
The information contained in this message is confidential and may be legally
privileged. The message is intended solely for the addressee(s). If you
are not the intended recipient, you are hereby notified that any use, dissemination,
or reproduction is strictly prohibited and may be unlawful. If you are
not the intended recipient, please contact the sender by return e-mail
and destroy all copies of the original message.</font></table>
<br>
<br>
<br>