On Thu, Dec 11, 2008 at 2:44 PM, Robert Dailey <span dir="ltr">&lt;<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Thu, Dec 11, 2008 at 12:19 PM, Andreas Pakulat <span dir="ltr">&lt;<a href="mailto:apaku@gmx.de" target="_blank">apaku@gmx.de</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div><div></div><div>On 11.12.08 10:55:42, Robert Dailey wrote:<br>
&gt; If I have a project in CMake that builds a shared library, what will happen<br>
&gt; if I set this shared library project as a parameter in<br>
&gt; target_link_libraries() for an executable project? What will happen to the<br>
&gt; DLL file? Will CMake copy it to the executable output directory<br>
&gt; automatically, or must I do this manually through CMake -E?<br>
<br>
</div></div>Inside the builddir? No it won&#39;t. If you however use the install() method<br>
together with the RUNTIME, ARCHIVE and LIBRARY options it will install the<br>
.dll into the RUNTIME directory and the import library into the ARCHIVE<br>
directory. So just make sure to provide all three for any install() call<br>
and .exe and .dll will end up in the same directory.</blockquote></div><br></div>I&#39;m finding that INSTALL() will not work unless a target is already
defined. This logically makes sense, of course, however this makes the
order in which I define my targets sensitive. Is it possible to
reference a target before it has been defined, or must I organize my
projects accordingly?<br>
</blockquote></div><br>To elaborate, I&#39;m specifically getting this error message:<br><br>CMake Error at vfx/CMakeLists.txt:74 (install):<br>&nbsp; install TARGETS given target &quot;messenger&quot; which does not exist in this<br>
&nbsp; directory.<br><br>And this is what my INSTALL() command looks like:<br><br>install( TARGETS messenger ARCHIVE DESTINATION &quot;${target_bin_dir}&quot; )<br><br><br>I have no idea what the error message above means. At first I thought it was due to the ordering in which I defined my projects, but I&#39;m not sure that&#39;s true. The &#39;messenger&#39; project is defined in another sibling directory, perhaps that is the issue?<br>