在 conanfiles 中安装构建时出错

getting error while installing build in conanfiles

当我 运行 在我的命令行

上执行此命令时,柯南包管理器出现了一些问题
conan install .. --build=missing

但是我的 conanfile.py

中出现了一些错误

Hello/0.1@mohammad/stable: ERROR: Package '90ee443cae5dd5c1b4861766ac14dc6fae231a92' build failed

Hello/0.1@mohammad/stable: WARN: Build folder /home/mohammad/.conan/data/Hello/0.1/mohammad/stable/build/90ee443cae5dd5c1b4861766ac14dc6fae231a92

ERROR: Hello/0.1@mohammad/stable: Error in build() method, line 14 cmake = CMake(self.settings) ConanException: First argument of CMake() has to be ConanFile. Use CMake(self)

这是我的conanfile.py

 import os, platform

 class HelloConan(ConanFile):
 name = "Hello"
 version = "0.1"
 settings = "os", "compiler", "build_type", "arch"

 def source(self):
    self.run("git clone https://github.com/memsharded/hello.git")

 def build(self):
    cmake = CMake(self.settings)
    self.run('cmake hello %s' % (cmake.command_line))
    self.run('cmake --build . %s' % cmake.build_config)

 def package(self):
    self.copy("*.h", dst="include", src="hello")
    self.copy("*.lib", dst="lib", keep_path=False)
    self.copy("*.a", dst="lib", keep_path=False)

 def package_info(self):
    self.cpp_info.libs = ["hello"]

报错信息很清楚的说出了什么问题:

First argument of CMake() has to be ConanFile. Use CMake(self)

您正在传递 self.settings 而不是:

cmake = CMake(self.settings)