Conan: This conanfile has no build step

Created on 1 Jul 2019  路  2Comments  路  Source: conan-io/conan

To help us debug your issue please explain:

  • [x] I've read the CONTRIBUTING guide.
  • [x] I've specified the Conan version, operating system version and any tool that can be relevant.
  • [x] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

When trying to run CMake from Conan. I consistently get the following error:

$ conan install . --install-folder build
$ conan build . --build-folder build
conanfile.py: Running build()
conanfile.py: WARN: This conanfile has no build step

The content of conanfile.py is as follows:

from conans import ConanFile, CMake

class LibConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    requires = "gflags/2.2.2@bincrafters/stable", "qt/5.13.0@bincrafters/stable", "zlib/1.2.11@conan/stable"
    generators = "cmake"
    default_options = {"qt:opengl": "desktop", "qt:with_mysql": False}

def build(self):
    cmake = CMake(self)
    cmake.configure()
    cmake.build()

I'm using Conan 1.16.1 on Fedora 30.

question

Most helpful comment

Hi @wouterbeek

There is a bad indention there. def build is part of LibConan, you need to add one indentation level:

from conans import ConanFile, CMake

class LibConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    requires = "gflags/2.2.2@bincrafters/stable", "qt/5.13.0@bincrafters/stable", "zlib/1.2.11@conan/stable"
    generators = "cmake"
    default_options = {"qt:opengl": "desktop", "qt:with_mysql": False}

    def build(self):
    cmake = CMake(self)
    cmake.configure()
    cmake.build()

All 2 comments

Hi @wouterbeek

There is a bad indention there. def build is part of LibConan, you need to add one indentation level:

from conans import ConanFile, CMake

class LibConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    requires = "gflags/2.2.2@bincrafters/stable", "qt/5.13.0@bincrafters/stable", "zlib/1.2.11@conan/stable"
    generators = "cmake"
    default_options = {"qt:opengl": "desktop", "qt:with_mysql": False}

    def build(self):
    cmake = CMake(self)
    cmake.configure()
    cmake.build()

Thanks for the fix!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bobeff picture bobeff  路  3Comments

uilianries picture uilianries  路  3Comments

zomeck picture zomeck  路  3Comments

liberforce picture liberforce  路  3Comments

mpdelbuono picture mpdelbuono  路  3Comments