Linking different libraries for Debug and Release builds in Cmake on windows?
2015-07-19 11:04
489 查看
问题叙述性说明:
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 release build (specifically the release or debug versions of those libraries). Is there an easy way to do this in Cmake?
解决方法:
target_link_libraries(<target> [lib1 [lib2 [...]]] [[debug|optimized|general] <lib>] ...)A "debug", "optimized", or "general" keyword indicates that the library immediately following it is to be used only for the corresponding build configuration.
So you should be able to do this:
add_executable( MyEXE ${SOURCES})
target_link_libraries( MyEXE debug 3PDebugLib)
target_link_libraries( MyEXE optimized 3PReleaseLib)
參考:
http://stackoverflow.com/questions/2209929/linking-different-libraries-for-debug-and-release-builds-in-cmake-on-windows
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 release build (specifically the release or debug versions of those libraries). Is there an easy way to do this in Cmake?
解决方法:
target_link_libraries(<target> [lib1 [lib2 [...]]] [[debug|optimized|general] <lib>] ...)A "debug", "optimized", or "general" keyword indicates that the library immediately following it is to be used only for the corresponding build configuration.
So you should be able to do this:
add_executable( MyEXE ${SOURCES})
target_link_libraries( MyEXE debug 3PDebugLib)
target_link_libraries( MyEXE optimized 3PReleaseLib)
參考:
http://stackoverflow.com/questions/2209929/linking-different-libraries-for-debug-and-release-builds-in-cmake-on-windows
相关文章推荐
- OpenCV Access pixel value
- 使用Fuel安装OpenStack juno之一安装Fuel Master
- 数据的刷新(UITableViewCell实现点击单元格弹窗更改数据)
- UITableView性能优化(复用池的使用原理)
- iOS切换到UiScrollView界面卡死
- 图片轮播器(UIScrollView-UIPageControl)
- 解决“Dynamic Web Module 3.0 requires Java 1.6 or newer.”错误
- 炫酷的AndroidUI库集合
- POJ 1947 Rebuilding Roads (树形DP)
- UITextView 不左上角显示
- 汤姆猫程序(UIImageView动画)
- Gitlab 上Iisues 使用以及代码管理
- UIView相对坐标转换
- ${pageContext.request.contextPath} JSP取得绝对路径
- poj1649 Rescue(BFS+优先队列)
- UIPopoverController和UIActionSheet在iPad中使用
- JSP之request对象
- 关于Hibernate的sequence diagram
- [LeetCode]Implement Queue using Stacks
- 玩转iOS 9的UIDynamics