我在命令行中运行此命令时,柯南软件包管理器遇到了一些问题
conan install .. --build=missing
但是我的 conanfile.py
出现了一些错误Hello/0.1@mohammad/stable:错误:程序包'90ee443cae5dd5c1b4861766ac14dc6fae231a92'构建失败
Hello/0.1@mohammad/stable:警告:构建文件夹/home/mohammad/.conan/data/Hello/0.1/mohammad/stable/build/90ee443cae5dd5c1b4861766ac14dc6fae231a92
错误:Hello/0.1@mohammad/stable:build()方法错误,第14行cmake = CMake(self.settings) ConanException:CMake()的第一个参数必须为ConanFile。使用CMake(自己)
这是我的 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"]
答案 0 :(得分:1)
该错误消息清楚地说明了问题所在:
CMake()的第一个参数必须是ConanFile。使用CMake(自己)
您正在通过self.settings
:
cmake = CMake(self.settings)