zoukankan      html  css  js  c++  java
  • 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


    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    机器人
    仙岛求药(一)
    YZM 二分查找
    珠心算测验升级版
    博客正在施工
    【其他】16年12月博客阅读索引^_^
    博客有新家了!
    POJ No.3617【B008】
    POJ No.2386【B007】
    【刷题记录】部分和问题
  • 原文地址:https://www.cnblogs.com/gcczhongduan/p/4658341.html
Copyright © 2011-2022 走看看