• <legend id='lWaSU'><style id='lWaSU'><dir id='lWaSU'><q id='lWaSU'></q></dir></style></legend>

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

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

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

        CMake 是否总是为所有可能的项目配置生成配置?

        Does CMake always generate configurations for all possible project configurations?(CMake 是否总是为所有可能的项目配置生成配置?)

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

            <bdo id='LC04L'></bdo><ul id='LC04L'></ul>
            <legend id='LC04L'><style id='LC04L'><dir id='LC04L'><q id='LC04L'></q></dir></style></legend>
              • <i id='LC04L'><tr id='LC04L'><dt id='LC04L'><q id='LC04L'><span id='LC04L'><b id='LC04L'><form id='LC04L'><ins id='LC04L'></ins><ul id='LC04L'></ul><sub id='LC04L'></sub></form><legend id='LC04L'></legend><bdo id='LC04L'><pre id='LC04L'><center id='LC04L'></center></pre></bdo></b><th id='LC04L'></th></span></q></dt></tr></i><div id='LC04L'><tfoot id='LC04L'></tfoot><dl id='LC04L'><fieldset id='LC04L'></fieldset></dl></div>
                  <tfoot id='LC04L'></tfoot>
                    <tbody id='LC04L'></tbody>
                  本文介绍了CMake 是否总是为所有可能的项目配置生成配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有调试和发布选项的特定配置(MSVC 和 GCC 不同).假设我们通过 cmake .. 生成默认项目.CMake 是否总是为所有可能的项目配置(调试和发布)生成配置,还是总是只获得一组配置选项?

                  I have specific configuration for debug and release options (diferent for MSVC and for GCC). Say we generate default project via cmake ... Does CMake always generate configurations for all possible project configurations (Debug and Release) or one always gets only one set of comfiguration options?

                  推荐答案

                  正如@cplusplusrat 所评论的,这取决于生成器/构建环境:

                  As @cplusplusrat has commented, this depends on the generator/build environment:

                  • 对于 MSVC 或 XCode 等多配置环境,是的.
                  • 对于 GCC 等单一配置环境,否.

                  单配置环境的默认设置既不是 Debug 也不是 Release(参见 此处 或 此处).

                  And the default for single-configuration environments is neither Debug nor Release (see here or here).

                  所以我一直定义一个CMAKE_BUILD_TYPE 用于单配置环境作为默认值.你也可以这样做,例如在调用 CMake 的构建脚本中:

                  So I have always defined one CMAKE_BUILD_TYPE for single-configuration environments as a default. You could also do this e.g. in build scripts calling CMake:

                  mingw_build.cmd

                  @ECHO off
                  SETLOCAL ENABLEDELAYEDEXPANSION
                  :: usage:
                  ::          mingw_build.cmd <target> <config>
                  ::                  <target> - target to be built (default: all)
                  ::                  <config> - configuration to be used for build (default: Debug)
                  
                  if NOT "%1" == "" (set CMAKE_TARGET=%1) else (set CMAKE_TARGET=all)
                  if NOT "%2" == "" (set CMAKE_BUILD_TYPE=%2) else (set CMAKE_BUILD_TYPE=Debug)
                  SET CMAKE_BINARY_DIR=%CMAKE_BUILD_TYPE%
                  
                  IF NOT EXIST "%CMAKE_BINARY_DIR%Makefile" (
                      cmake -H"." -B"%CMAKE_BINARY_DIR%" -DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% -G"MinGW Makefiles"
                  )
                  cmake --build %CMAKE_BINARY_DIR% --target %CMAKE_TARGET%
                  
                  ENDLOCAL 
                  

                  vs_x64_build.cmd

                  @ECHO off
                  SETLOCAL ENABLEDELAYEDEXPANSION
                  :: usage:
                  ::          vs_x64_build.cmd <target> <config>
                  ::                  <target> - target to be built (default: ALL_BUILD)
                  ::                  <config> - configuration to be used for build (default: Debug)
                  
                  if NOT "%1" == "" (SET CMAKE_TARGET=%1) else (SET CMAKE_TARGET=ALL_BUILD)
                  if NOT "%2" == "" (set CMAKE_BUILD_TYPE=%2) else (set CMAKE_BUILD_TYPE=Debug)
                  SET CMAKE_BINARY_DIR=x64
                  
                  IF NOT EXIST "%CMAKE_BINARY_DIR%*.sln" (
                      cmake -H"." -B"%CMAKE_BINARY_DIR%" -G"Visual Studio 14 2015 Win64"
                  )
                  cmake --build "%CMAKE_BINARY_DIR%" --target "%CMAKE_TARGET%" --config "%CMAKE_BUILD_TYPE%"
                  
                  ENDLOCAL 
                  

                  这篇关于CMake 是否总是为所有可能的项目配置生成配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  What is inside .lib file of Static library, Statically linked dynamic library and dynamically linked dynamic library?(静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么?)
                  How do I load a C DLL from the SXS in Python?(如何从 Python 中的 SXS 加载 C DLL?)
                  Can Cython code be compiled to a dll so C++ application can call it?(Cython 代码可以编译成 dll 以便 C++ 应用程序可以调用它吗?)
                  Delay Loading DLLs(延迟加载 DLL)
                  Throwing C++ exceptions across DLL boundaries(跨 DLL 边界抛出 C++ 异常)
                  Loading a dll from a dll?(从 dll 加载 dll?)

                        <bdo id='eWe8P'></bdo><ul id='eWe8P'></ul>
                        <legend id='eWe8P'><style id='eWe8P'><dir id='eWe8P'><q id='eWe8P'></q></dir></style></legend>

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

                            <tbody id='eWe8P'></tbody>

                            <tfoot id='eWe8P'></tfoot>