On Tue, Nov 10, 2009 at 10:43:49AM -0800, Meng Zhang wrote: > target_link_libraries(A debug Debug/B) > target_link_libraries(A optimized Release/B) > > Nevertheless, obviously, since optimized means all the other three > configurations except "Debug", project A won't find library B if I directly > build "MinSizeRel" version because the compiler can not find library B in > directory Release/.
If you give target_link_libraries() a "library" that's the name of a target in your CMake system, CMake will automatically figure out where it has built that target and will link to it for you. Thus, all you need to do is: target_link_libraries(A B) When you do a Debug build, A will link against the debug B. When you do a MinSizeRel build, A will link against the minsizerel B. hth, tyler _______________________________________________ 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