Debug and Release Library Linking with CMAKE (VISUAL STUDIO)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: There was already a Thread which did not help really. I want to be able to link for example Foo.lib for Release Config and Foo_d.lib for Debug Config , how can I achieve this? If I do this: target_link_libraries(MyEXE debug Foo_d) target_link_libraries(MyEXE optimized Foo) then I have both libraries in my project for the debug config? Why is there no Release option? Thanks alot! 回答1: The solution is: SET(LINK_LIBRARY optimized Foo debug Foo_d) target_link_libraries(MyEXE ${LINK_LIBRARY}) 回答2: target_link_libraries takes a list, you don't