cmake - 设置 CMake 构建中的线程数

标签 cmake

cmake --build . --config Release

是否可以设置构建过程使用的核心数量?

我正在寻找类似于 GNU make 的 -j 选项的内容。

最佳答案

根据Release Notes ,使用 CMake 3.12 可以跨平台完成:

The cmake(1) Build Tool Mode (cmake –build) gained --parallel [<jobs>] and -j [<jobs>] options to specify a parallel build level. They map to corresponding options of the native build tool.

关于cmake - 设置 CMake 构建中的线程数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36633074/

相关文章:

cmake - 使用 MSVC++ 2013 编译时为 "no known features for CXX compiler"

c++ - CMake 在 Debian 上找不到 boost_program_options

c++ - 在 CMake 中使用编译器前缀命令(distcc、ccache)

CMake:覆盖查找模块

c++ - Assimp 无法在 Code::Blocks 中正确构建 - "TVITEMEXW not declared in current scope"

c++ - CMake如何在VC2010上设置正确的包含路径前缀?

function - 如何使用 CMake 检查 accept4

opencv - OpenKinect:无法构建 RGBDemo

path - CMake-CPack软件包安装路径的噩梦

c++ - 在 cmake 中设置最低版本的 boost