CMake未找到忍者 [英] Ninja not found by CMake

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

问题描述

我正在尝试使用CMake构建从GitHub获取的代码,但是不断出现以下错误:

I'm trying to build some code I got from GitHub using CMake, but keep getting the followings errors:

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 Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:/golang/project/src/github.com/devsisters/goquic/libquic/build/debug/CMakeFiles/2.8.11/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:/golang/project/src/github.com/devsisters/goquic/libquic/build/debug/CMakeFiles/2.8.11/CMakeCXXCompiler.cmake
-- Configuring incomplete, errors occurred!

如何正确设置这些变量?

How do I set these variables correctly?

我使用了GitHub代码随附的 ./ build_libs.sh 文件来构建它。

I used a ./build_libs.sh file that came with the GitHub code to build this.

推荐答案

您正在执行的脚本使用CMake Ninja生成器。为此,您需要在路径上安装忍者。在大多数Linux发行版中,您可以从软件包中安装它。

The script you are executing uses the CMake Ninja generator. For that to work you need Ninja on the path. On most Linux distributions you can install it from a package.

Ubuntu:ninja-build

Ubuntu: ninja-build

openSUSE :忍者

如果找不到分发时,您必须下载它并将其位置添加到 path 环境变量中。

If you can't find it for your distribution, you have to download it and add its location to the path environment variable.

这篇关于CMake未找到忍者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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