mmdii
mmdii

Reputation: 184

getting error while installing build in conanfiles

I've got some problem with conan package manager When I run this command on my command line

conan install .. --build=missing

but i got some error in my 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)

This is my 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"]

Upvotes: 2

Views: 3138

Answers (1)

Paul
Paul

Reputation: 13238

The error message clearly says what's wrong:

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

You are passing self.settings instead:

cmake = CMake(self.settings)

Upvotes: 3

Related Questions