在MacOS上使用Ninja的CMake GUI [英] CMake GUI with Ninja on macOS

查看:244
本文介绍了在MacOS上使用Ninja的CMake GUI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用CMake GUI创建Ninja构建文件.

I'm trying to create Ninja build files using CMake GUI.

我尝试使用Brew和手动在Mac OS上安装Ninja.两次,我都确保PATH上可以使用忍者,但是CMake GUI从未找到忍者.

I've tried to install Ninja on macOS using Brew and manually. Both times I made sure that ninja is available on the PATH but CMake GUI was never able to find ninja.

CMake错误:CMake无法找到与"Ninja"相对应的构建程序.未设置CMAKE_MAKE_PROGRAM.您可能需要选择其他构建工具.

CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.

CMake在命令行上可以找到忍者.只是cmake-GUI不是.

CMake on command line is able to find ninja. Just cmake-GUI is not.

任何暗示都值得赞赏.

推荐答案

从Finder中启动应用程序时(例如,双击其图标),它不一定与启动时的 PATH 相同.从命令行.您可以使用以下内容使用简单的CMakeLists.txt查看差异:

When apps are launched from the Finder (e.g. double-clicking on its icon), it is not necessarily the same PATH as launching from a command line. You can see the difference using a trivial CMakeLists.txt with the following contents:

cmake_minimum_required(VERSION 3.1)
message("ENV{PATH} = $ENV{PATH}")
project(foo)

如果通过Finder启动CMake GUI应用程序并将上述文件用作构建项目,则输出可能会显示如下路径:

If you launch the CMake GUI app through the Finder and use the above file as the project to build, the output will probably show a path like this:

ENV{PATH} = /usr/bin:/bin:/usr/sbin:/sbin

如果您直接从命令行运行CMake GUI(例如,/Applications/CMake.app/Contents/bin/cmake-gui 而不是 open/Applications/CMake.app),那么PATH应该与您在命令行中看到的相同,假设您已经在中进行了设置,那么您可能会在其中包含/usr/local/bin 〜/.bash_profile 或类似的文件.

If you run CMake GUI from a command line directly (e.g. /Applications/CMake.app/Contents/bin/cmake-gui rather than open /Applications/CMake.app), the PATH should be the same as you are used to seeing from the command line, which for you probably includes /usr/local/bin assuming you've set that in your ~/.bash_profile or similar.

这篇关于在MacOS上使用Ninja的CMake GUI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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