-D定义是什么告诉CMake在哪里可以找到nmake? [英] What is the -D define to tell CMake where to find nmake?

查看:83
本文介绍了-D定义是什么告诉CMake在哪里可以找到nmake?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 Visual C ++ Build Tools 2015 |在低端上网本上安装了独立的编译器,库和脚本.这是必要的,因为该机器具有焊接到板上的小eMMC,没有可用空间.

I have Visual C++ Build Tools 2015 | Standalone compiler, libraries and scripts installed on a low-end netbook. It's necessary, because the machine has a small eMMC soldered to the board with no real space available.

nmake 安装在%PROGRAM FILES%\ Microsoft Visual Studio 14.0 \ VC \ bin 中.但是,CMake在尝试生成Makefile时找不到它.我想使用 -D 告诉CMake makefile程序是什么,但是我在定位

nmake is installed at %PROGRAM FILES%\Microsoft Visual Studio 14.0\VC\bin. However, CMake cannot find it when attempting to generate the Makefile. I'd like to use a -D to tell CMake what the makefile program is, but I am having trouble locating the list of -D defines for CMake.

出于完整性考虑,我正在尝试避免使用其他Microsoft工具.我在 C:\ LLVM \ bin 处有LLVM构建工具,因此我在设置 CMAKE_C_COMPILER CMAKE_CXX_COMPILER .但是我需要 nmake ,因为找不到适用于Windows的独立Make程序.

For completeness, I'm trying to avoid other Microsoft tools. I have LLVM build tools at C:\LLVM\bin, so I'm setting CMAKE_C_COMPILER and CMAKE_CXX_COMPILER. But I needed nmake, because I can't find a stand-alone Make program for Windows already built.

为CMake指定nmake的 -D 定义是什么?

What is the -D define to specify nmake for CMake?

推荐答案

您要查找的变量是

The variable you are looking for is CMAKE_MAKE_PROGRAM.

如果尝试设置此变量以及 CMAKE_C_COMPILER CMAKE_LINKER_EXE 等,该操作仍将失败,因为cl.exe和link.exe需要一些环境变量来被设置.可以使用"Visual Studio *命令提示符"(这使用Visual Studio安装目录中的vcvars.bat)进行设置.

If you try to set this variable plus CMAKE_C_COMPILER, CMAKE_LINKER_EXE, etc., this will still fail, because cl.exe and link.exe need some environment variables to be set. Those can be set by using a "Visual Studio * Command Prompt" (this uses vcvars.bat from the Visual Studio install directory).

要使用Clang,您可以从 http://llvm.org/builds/安装Clang工具集.然后,您可以在工具链文件中指定 CMAKE_GENERATOR_TOOLSET .

To use Clang you can install a Clang toolset from http://llvm.org/builds/. Then you can specify CMAKE_GENERATOR_TOOLSET in a toolchain file.

让我知道这对您有何帮助.

Let me know how this works out for you.

这篇关于-D定义是什么告诉CMake在哪里可以找到nmake?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆