Narrative description of the problem:
So I ' ve got a library I ' m compiling and I need to link different third party things in depending on if it ' s the Debug or R Elease build (specifically the release or debug versions of those libraries). Is there a easy-to-do Cmake?
Workaround:
Target_link_libraries (<target> [LIB1 [LIB2 [...]] [[Debug|optimized|general] <lib>] A "Debug", "Optimized", or "general" keyword indicates that the library immediately following it's to being used only for th e corresponding build configuration.
So you should is able to does this:
Add_executable (Myexe ${sources})
Target_link_libraries (Myexe debug 3PDebugLib)
Target_link_libraries (Myexe optimized 3PReleaseLib)
References:
Http://stackoverflow.com/questions/2209929/linking-different-libraries-for-debug-and-release-builds-in-cmake-on-windows
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
Linking different libraries for Debug and Release builds in Cmake on Windows?