<small id='e0p2h'></small><noframes id='e0p2h'>

<i id='e0p2h'><tr id='e0p2h'><dt id='e0p2h'><q id='e0p2h'><span id='e0p2h'><b id='e0p2h'><form id='e0p2h'><ins id='e0p2h'></ins><ul id='e0p2h'></ul><sub id='e0p2h'></sub></form><legend id='e0p2h'></legend><bdo id='e0p2h'><pre id='e0p2h'><center id='e0p2h'></center></pre></bdo></b><th id='e0p2h'></th></span></q></dt></tr></i><div id='e0p2h'><tfoot id='e0p2h'></tfoot><dl id='e0p2h'><fieldset id='e0p2h'></fieldset></dl></div>
  • <legend id='e0p2h'><style id='e0p2h'><dir id='e0p2h'><q id='e0p2h'></q></dir></style></legend>
    <tfoot id='e0p2h'></tfoot>

          <bdo id='e0p2h'></bdo><ul id='e0p2h'></ul>

        在 Windows 上的 Cmake 中为调试和发布构建链接不同的库?

        Linking different libraries for Debug and Release builds in Cmake on windows?(在 Windows 上的 Cmake 中为调试和发布构建链接不同的库?)

          <small id='mZoWg'></small><noframes id='mZoWg'>

        1. <tfoot id='mZoWg'></tfoot>
            <bdo id='mZoWg'></bdo><ul id='mZoWg'></ul>
          • <i id='mZoWg'><tr id='mZoWg'><dt id='mZoWg'><q id='mZoWg'><span id='mZoWg'><b id='mZoWg'><form id='mZoWg'><ins id='mZoWg'></ins><ul id='mZoWg'></ul><sub id='mZoWg'></sub></form><legend id='mZoWg'></legend><bdo id='mZoWg'><pre id='mZoWg'><center id='mZoWg'></center></pre></bdo></b><th id='mZoWg'></th></span></q></dt></tr></i><div id='mZoWg'><tfoot id='mZoWg'></tfoot><dl id='mZoWg'><fieldset id='mZoWg'></fieldset></dl></div>

            • <legend id='mZoWg'><style id='mZoWg'><dir id='mZoWg'><q id='mZoWg'></q></dir></style></legend>
                <tbody id='mZoWg'></tbody>

                  本文介绍了在 Windows 上的 Cmake 中为调试和发布构建链接不同的库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  所以我有一个正在编译的库,我需要根据它是调试版本还是发布版本(特别是这些库的发布版本或调试版本)来链接不同的第三方内容.在 Cmake 中有没有一种简单的方法可以做到这一点?

                  我应该注意我使用的是visual studio

                  解决方案

                  根据 CMake 文档:

                  target_link_libraries( [lib1 [lib2 [...]]] [[debug|optimized|general] ] ...)

                  <块引用>

                  调试"、优化"或常规"关键字表示库紧随其后使用仅适用于相应的构建配置.

                  所以你应该能够做到这一点:

                  add_executable( MyEXE ${SOURCES})target_link_libraries(MyEXE 调试 3PDebugLib)target_link_libraries(MyEXE优化的3PReleaseLib)

                  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?

                  Edit: I should note I'm using visual studio

                  解决方案

                  According to the CMake documentation:

                  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)
                  

                  这篇关于在 Windows 上的 Cmake 中为调试和发布构建链接不同的库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)
                  Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)
                  STL BigInt class implementation(STL BigInt 类实现)
                  Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)
                  Move list element to the end in STL(在 STL 中将列表元素移动到末尾)
                  Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)
                    <tbody id='BKrWb'></tbody>

                  <small id='BKrWb'></small><noframes id='BKrWb'>

                  <legend id='BKrWb'><style id='BKrWb'><dir id='BKrWb'><q id='BKrWb'></q></dir></style></legend>
                  <i id='BKrWb'><tr id='BKrWb'><dt id='BKrWb'><q id='BKrWb'><span id='BKrWb'><b id='BKrWb'><form id='BKrWb'><ins id='BKrWb'></ins><ul id='BKrWb'></ul><sub id='BKrWb'></sub></form><legend id='BKrWb'></legend><bdo id='BKrWb'><pre id='BKrWb'><center id='BKrWb'></center></pre></bdo></b><th id='BKrWb'></th></span></q></dt></tr></i><div id='BKrWb'><tfoot id='BKrWb'></tfoot><dl id='BKrWb'><fieldset id='BKrWb'></fieldset></dl></div>
                  1. <tfoot id='BKrWb'></tfoot>

                          • <bdo id='BKrWb'></bdo><ul id='BKrWb'></ul>