Hi,<br><br>Suppose, IMPORTED libraries should help. Following is text from CMake manual:<br><br>Higher granularity may be achieved for per-configuration rules by
creating and linking to IMPORTED library targets. See the IMPORTED mode
of the add_library command for more information.<br><br>See also <a href="http://www.cmake.org/Wiki/CMake_2.6_Notes#Importing_Targets">http://www.cmake.org/Wiki/CMake_2.6_Notes#Importing_Targets</a><br><br><div class="gmail_quote">
2009/3/2  <span dir="ltr">&lt;<a href="mailto:jesseperla@gmail.com" target="_blank">jesseperla@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

For nmake, I think you do it conditional based on the BUILD_TYPE variable.  But this won&#39;t work for visual studio, because this variable isn&#39;t available.  Noone answered my original question about this... Can you repost to the mailing list the question?<br>

<br>The only thing I can think of is to have an option(USE_MD) or something, where you can generate the libraries differently depending on this option in the cache.  But I really don&#39;t know cmake all that well.<div><div>

</div><div><br><br>On Mar 2, 2009 1:28pm, Dmytro Ovdiienko &lt;<a href="mailto:dmitriy.ovdienko@gmail.com" target="_blank">dmitriy.ovdienko@gmail.com</a>&gt; wrote:<br>&gt; All,<br>&gt; <br>&gt; if I have several configurations (e.g. /MT, /MTd, /MD,<br>

&gt; /MDd), how can I pass additional libraries to the<br>&gt; target_link_libraries? I have two optimized libaries. One for /MT and<br>&gt; one for /MD.<br>&gt; <br>&gt; Thanks,<br>&gt; Dima<br>&gt; <br>&gt; 2009/2/25  <a href="mailto:jesseperla@gmail.com" target="_blank">jesseperla@gmail.com</a>&gt;<br>

&gt; <br>&gt; On Wed, Feb 25, 2009 at 1:38 AM, Hendrik Sattler <a href="mailto:post@hendrik-sattler.de" target="_blank">post@hendrik-sattler.de</a>&gt; wrote:<br>&gt; debug and optimized keywords are followed by _one_ library. The help entry<br>

&gt; <br>&gt; defines this correctly.<br>&gt; <br>&gt; <br>&gt; Thanks and sorry I missed that in the help.  cmake really is amazing, but I also find it massive.  The &quot;Mastering Cmake&quot; book is excellent, but if people write an even longer text with lots of tutorial examples I promise to buy it.<br>

&gt; <br>&gt; <br>&gt; I have now changed things around to do the following:<br>&gt; #Set in my find module.<br>&gt; set(ETK_LIBS   debug scl-d<br>&gt;                         optimized scl<br>&gt;                         debug libIpopt-mt-d<br>&gt;                         optimized libIpopt-mt) #in reality, there are about 20 libs<br>

&gt; <br>&gt; <br>&gt; #set in my cmakelists.txt for my project.<br>&gt; add_executable(hello2 ${hello2_SRCS})<br>&gt; target_link_libraries(hello2 ${ETK_LIBS })<br>&gt; <br>&gt; Is this the best way to setup long lists of libraries to link in?<br>

&gt; <br>&gt; And is there any way for me to have separate lists that work for my custom build type that works in visual studio?  I want an MPI and heavily optimized build type that people can choose.<br>&gt; <br>&gt; _______________________________________________<br>

&gt; <br>&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>&gt; <br>&gt; <br>&gt; <br>&gt; 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>

&gt; <br>&gt; <br>&gt; <br>&gt; 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>&gt; <br>&gt; <br>&gt; <br>

&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <br>&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>&gt; <br>&gt; <br>&gt;</div></div>
</blockquote>
</div><br>