未找到 CMAKE_MAKE_PROGRAM [英] CMAKE_MAKE_PROGRAM not found
问题描述
我已经用 CMake 走到了尽头;它有很大的潜力,但我似乎无法让它找到基本的系统工具(即 make
)来运行.
I have reached the end of my rope with CMake; it has so much potential, but I cannot seem to make it find the basic system tools (i.e. make
) in order to function.
CMake 和 CMake GUI 生成以下内容(删除 CMakeCache.txt 文件后):
CMake and the CMake GUI produce the following (after deleting the CMakeCache.txt file):
Processing top-level CMakelists.txt for project swb
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".
CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
我专注于在这个问题中找到 make
,但是,我也遇到了许多与 CMake 无法找到库和其他实用程序文件(链接器、nm、ar 等)相同的问题.)我在下面列出的技术似乎使 CMake 在 Linux 下运行时能够找到这些文件.
I am focusing on finding make
in this question, however, I've also had many of the same issues with CMake failing to find libraries and other utility files (linker, nm, ar, etc.). The techniques I list below seem to enable CMake to find these files when running under Linux.
Windows 7(64 位);多个版本的 MinGW(32 位/64 位);Cmake 2.8.4;MinGW 的非标准安装位置 (c:/MinGW-32).
Windows 7 (64-bit); multiple versions of MinGW (32-bit/64-bit); Cmake 2.8.4; NONSTANDARD install location for MinGW (c:/MinGW-32 ).
CMakelists.txt 在文件的前 10 行中包含
SET( CMAKE_MAKE_PROGRAM c:/MinGW-32/bin/make.exe FORCE)
.
以前版本的 CMakelists.txt 包含:
Previous versions of CMakelists.txt contained:
find_program(CMAKE_MAKE_PROGRAM
NAMES make
make.exe
DOC "Find a suitable make program for building under Windows/MinGW"
HINTS c:/MinGW-32/bin )
在运行 CMake 或 CMake-GUI 之前,在 cmd.exe 环境变量中设置 CMAKE_MAKE_PROGRAM
.
使用识别CMAKE_MAKE_PROGRAM
以及CMAKE_C_COMPILER
等的工具链"文件
Use of a "toolchain" file which identifies CMAKE_MAKE_PROGRAM
as well as CMAKE_C_COMPILER
, etc.
成功的一件事
如果我使用 GUI 填充 CMAKE_MAKE_PROGRAM
变量(C:/MinGW-32/bin/make.exe"),CMake 将成功创建构建文件.
ONE THING THAT HAS WORKED
CMake will successfully create build files IF I use the GUI to populate the CMAKE_MAKE_PROGRAM
variable ("C:/MinGW-32/bin/make.exe").
如果我通过 GUI 识别 make 程序的名称,我可以让 CMake 工作.如何让 CMake 在没有用户干预的情况下通过 Windows 7(64 位)/MinGW 组合找到我的 make 程序?
I can get CMake to work if I identify the name of the make program via the GUI. How does one enable CMake to find my make program without user intervention with the Windows 7 (64-bit) / MinGW combination?
推荐答案
我有两个建议:
你的 %PATH% 环境变量中有 make 吗?在我的系统上,我需要将 %MINGW_DIR%in 添加到 %PATH%.
Do you have make in your %PATH% environment variable? On my system, I need to add %MINGW_DIR%in to %PATH%.
你有没有安装make?根据您的 mingw 安装,它可以是一个单独的包.
Do you have make installed? Depending on your mingw installation, it can be a separate package.
最后的手段:你能在命令行传递完整的路径吗?cmake -D"CMAKE_MAKE_PROGRAM:PATH=C:/MinGW-32/bin/make.exe" ..Source
Last resort: Can you pass the full path to make on the commandline? cmake -D"CMAKE_MAKE_PROGRAM:PATH=C:/MinGW-32/bin/make.exe" ..Source
这篇关于未找到 CMAKE_MAKE_PROGRAM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!