In your target_link_libraries statements, use:<br><br>- cmake target names to link to, if there are cmake targets for the linked-to libraries,<br>- full path file names for the libraries if there are not cmake targets for them<br>
<br>Are you doing that? If so, 2.6 and 2.8 should work the same.<br><br><br>HTH,<br>David<br><br><br><div class="gmail_quote">On Thu, Jun 10, 2010 at 2:34 PM, Ed Loper <span dir="ltr">&lt;<a href="mailto:eloper@bbn.com">eloper@bbn.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I have a CMake project that works fine with CMake 2.6, but when I build Visual Studio output with CMake 2.8, it doesn&#39;t seem to get the target library linking information quite right.  Here&#39;s a simplified version of my project:<br>

<br>
Project/CMakeLists.txt<br>
  -------------------------------------------------------<br>
  ADD_SUBDIRECTORY(Foo)<br>
  ADD_SUBDIRECTORY(Bar)<br>
  -------------------------------------------------------<br>
<br>
Project/Foo/CMakeLists.txt<br>
  -------------------------------------------------------<br>
  SET (LIBRARY Foo)<br>
  # [...]<br>
  GENERATE_PROJECT (${LIBRARY} &quot;${SOURCE_FILES}&quot; )<br>
  ADD_LIBRARY (${LIBRARY} STATIC ${SOURCE_FILES})<br>
  -------------------------------------------------------<br>
<br>
Project/Bar/CMakeLists.txt<br>
  -------------------------------------------------------<br>
  # [...]<br>
  ADD_EXECUTABLE (${BAR} ${SOURCE_FILES})<br>
  TARGET_LINK_LIBRARIES(${FOO} ${BAR})<br>
  -------------------------------------------------------<br>
<br>
Under CMake 2.6, the Visual Studio project file for Bar would link to &quot;..\Foo\$(OutDir)\Foo.lib&quot;.  But under CMake 2.8, it tries to link to just &quot;Foo.lib&quot;, and Visual Studio can&#39;t find it.  In particular, the &#39;AdditionalDependencies&#39; field in the vcproj file is different:<br>

<br>
=======================================================================<br>
--- old_bar.vcproj<br>
+++ new_bar.vcproj<br>
=======================================================================<br>
 &lt;Configuration Name=&quot;RelWithDebInfo|Win32&quot;<br>
                OutputDirectory=&quot;RelWithDebInfo&quot; [...]&gt;<br>
    [...]<br>
    &lt;Tool Name=&quot;VCLinkerTool&quot;<br>
          LinkLibraryDependencies=&quot;false&quot;<br>
          AdditionalOptions=&quot; /STACK:10000000 /machine:I386 /debug&quot;<br>
          AdditionalDependencies=&quot;$(NOINHERIT) kernel32.lib user32.lib<br>
-             gdi32.lib [...] ..\Foo\$(OutDir)\Foo.lib&quot;<br>
+             gdi32.lib [...] Foo.lib&quot;<br>
          [...]/&gt;<br>
 &lt;/Configuration&gt;<br>
=======================================================================<br>
<br>
Any idea what might be causing this and/or what I could do to fix it?<br>
<br>
Thanks,<br>
-Edward<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br>