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"><<a href="mailto:jesseperla@gmail.com" target="_blank">jesseperla@gmail.com</a>></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't work for visual studio, because this variable isn'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't know cmake all that well.<div><div>
</div><div><br><br>On Mar 2, 2009 1:28pm, Dmytro Ovdiienko <<a href="mailto:dmitriy.ovdienko@gmail.com" target="_blank">dmitriy.ovdienko@gmail.com</a>> wrote:<br>> All,<br>> <br>> if I have several configurations (e.g. /MT, /MTd, /MD,<br>
> /MDd), how can I pass additional libraries to the<br>> target_link_libraries? I have two optimized libaries. One for /MT and<br>> one for /MD.<br>> <br>> Thanks,<br>> Dima<br>> <br>> 2009/2/25 <a href="mailto:jesseperla@gmail.com" target="_blank">jesseperla@gmail.com</a>><br>
> <br>> 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>> wrote:<br>> debug and optimized keywords are followed by _one_ library. The help entry<br>
> <br>> defines this correctly.<br>> <br>> <br>> Thanks and sorry I missed that in the help. cmake really is amazing, but I also find it massive. The "Mastering Cmake" book is excellent, but if people write an even longer text with lots of tutorial examples I promise to buy it.<br>
> <br>> <br>> I have now changed things around to do the following:<br>> #Set in my find module.<br>> set(ETK_LIBS debug scl-d<br>>                         optimized scl<br>>                         debug libIpopt-mt-d<br>>                         optimized libIpopt-mt) #in reality, there are about 20 libs<br>
> <br>> <br>> #set in my cmakelists.txt for my project.<br>> add_executable(hello2 ${hello2_SRCS})<br>> target_link_libraries(hello2 ${ETK_LIBS })<br>> <br>> Is this the best way to setup long lists of libraries to link in?<br>
> <br>> 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>> <br>> _______________________________________________<br>
> <br>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>> <br>> <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>> <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>> <br>> <br>
> Follow this link to subscribe/unsubscribe:<br>> <br>> <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>> <br>> <br>></div></div>
</blockquote>
</div><br>