找不到CMAKE_MAKE_PROGRAM [英] CMAKE_MAKE_PROGRAM not found

查看:2219
本文介绍了找不到CMAKE_MAKE_PROGRAM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用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 ).

  1. 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_PROGRAMCMAKE_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?

    推荐答案

    我有两个建议:

    1. 您的%PATH%环境变量中是否包含make?在我的系统上,我需要将%MINGW_DIR%\ bin添加到%PATH%.

    1. Do you have make in your %PATH% environment variable? On my system, I need to add %MINGW_DIR%\bin to %PATH%.

    您已经安装了吗?取决于您的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屋!

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