<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 20 August 2015 at 17:33, Howard Rubin <span dir="ltr"><<a href="mailto:howard.rubin@hl.konicaminolta.us" target="_blank">howard.rubin@hl.konicaminolta.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="#0563C1" vlink="#954F72"><div><p class="MsoNormal">I have a C++/CLI LIB (and DLL) that I generate with include_external_msproject. I need to link to it from my C++ project, which I’m trying to do with target_link_libraries. This gives the below error message. Since I’m not creating it with add_library I don’t see how to indicate it’s a shared lib.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">How can I indicate the lib is a SHARED lib, or otherwise link to it in a CMake project?<u></u><u></u></p><p class="MsoNormal"><u></u> </p></div></div></blockquote><div><br></div><div>Simply put, you cannot use  target_link_libraries() with targets created with include_external_msproject().</div><div>To make it work, just use add_dependencies() instead. </div><div>I don't remember how to specify SHARED in this case but I think it totally depends on the settings of the VS project file. </div><div>It's one of the reasons some old project distribute the project file twice, one as shared library, the other as static library.</div><div><br></div></div></div></div>