<div dir="ltr">If you do...:<br>dumpbin /symbols mylib.lib<br><br>...then:<br>The output will contain &quot;_IMPORT_DESCRIPTOR&quot; if the .lib is an import library for a .dll file.<br>It will (most likely) not contain this output if it is a static .lib file.<br>
<br>It&#39;s a heuristic as I&#39;m pretty sure the static .lib file will contain that output if you have, for example, a function named &quot;PRINT_IMPORT_DESCRIPTOR&quot; in your library... But the absence of that string tells you that it is *not* an import library for a .dll.<br>
<br>You could easily write a CMake macro that calls dumpbin with EXECUTE_PROCESS and capture its output into a variable and analyze it.<br><br>(dumpbin.exe is usually available in the &quot;VC\bin&quot; directory of a Visual Studio installation... easily accessible from a VC command prompt...)<br>
<br><br>HTH,<br>David<br><br><br><div class="gmail_quote">On Thu, Jul 17, 2008 at 4:09 PM, Philip Lowman &lt;<a href="mailto:philip@yhbt.com">philip@yhbt.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
<br>
...... Original Message .......<br>
<div class="Ih2E3d">On Thu, 17 Jul 2008 22:10:11 +0400 &quot;Yuri Timenkov&quot;<br>
&lt;<a href="mailto:ytimenkov@parallels.com">ytimenkov@parallels.com</a>&gt; wrote:<br>
&gt;On Thursday 17 July 2008 23:00:15 Alin M Elena wrote:<br>
</div><div class="Ih2E3d">&gt;The main problem AFAIK for VS is that static and dynamic libraries are<br>
&gt;indistinguishable by extension. They both have a .lib one. And you don&#39;t<br>
know<br>
&gt;in advance is some library is static one or just import library for some<br>
&gt;dynamic one.<br>
<br>
</div>I would be quite frankly amazed if someone couldn&#39;t write a 10-line CMake<br>
macro that can determine if a .LIB file is static or shared. &nbsp;I wonder if<br>
simply keying on certain ASCII keywords in the .LIB file wouldn&#39;t be good<br>
enough (this would need some testing though, unless someone can find a<br>
detailed .LIB file specification).<br>
<br>
--<br>
<font color="#888888">Philip Lowman<br>
</font><div><div></div><div class="Wj3C7c">_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>