Hi, Suppose, IMPORTED libraries should help. Following is text from CMake manual:
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. See also http://www.cmake.org/Wiki/CMake_2.6_Notes#Importing_Targets 2009/3/2 <[email protected]> > 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? > > 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. > > > On Mar 2, 2009 1:28pm, Dmytro Ovdiienko <[email protected]> > wrote: > > All, > > > > if I have several configurations (e.g. /MT, /MTd, /MD, > > /MDd), how can I pass additional libraries to the > > target_link_libraries? I have two optimized libaries. One for /MT and > > one for /MD. > > > > Thanks, > > Dima > > > > 2009/2/25 [email protected]> > > > > On Wed, Feb 25, 2009 at 1:38 AM, Hendrik Sattler [email protected]> > wrote: > > debug and optimized keywords are followed by _one_ library. The help > entry > > > > defines this correctly. > > > > > > 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. > > > > > > I have now changed things around to do the following: > > #Set in my find module. > > set(ETK_LIBS debug scl-d > > optimized scl > > debug libIpopt-mt-d > > optimized libIpopt-mt) #in reality, there are about 20 libs > > > > > > #set in my cmakelists.txt for my project. > > add_executable(hello2 ${hello2_SRCS}) > > target_link_libraries(hello2 ${ETK_LIBS }) > > > > Is this the best way to setup long lists of libraries to link in? > > > > 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. > > > > _______________________________________________ > > > > Powered by www.kitware.com > > > > > > > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > > > > > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > > > > > > > Follow this link to subscribe/unsubscribe: > > > > http://www.cmake.org/mailman/listinfo/cmake > > > > > > >
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
