Skip to content
Generic Conan recipes for CMake and Python projects.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
autorecipes
docs
tests
.appveyor.yml
.gitignore
.pydocstyle
.pylintrc
.readthedocs.yml
.style.yapf
.travis.yml
LICENSE
README.rst
conanfile.py
mypy.ini
pyproject.toml
tasks.py

README.rst

autorecipes

Generic Conan recipes for C/C++ and Python projects.

Latest Bintray version Build status: Linux and OSX Build status: Windows

C/C++

If your project

  • uses CMake,
  • and installs a package configuration file
  • that defines the variable <PACKAGE_NAME>_COMPONENTS
  • with a list of components,
  • and for each of them defines a target <package_name>::<component>,

then you should be able to copy this recipe to package it for Conan:

from conans import python_requires

CMakeConanFile = python_requires('autorecipes/[*]@jfreeman/testing').cmake()

class Recipe(CMakeConanFile):
    name = CMakeConanFile.__dict__['name']
    version = CMakeConanFile.__dict__['version']

Python

If your project

  • uses Poetry,
  • with a pyproject.toml package metadata file as defined in PEP 518,

then you should be able to copy this recipe to package it for Conan:

from conans import python_requires

PythonConanFile = python_requires('autorecipes/[*]@jfreeman/testing').python()

class Recipe(PythonConanFile):
    name = PythonConanFile.__dict__['name']
    version = PythonConanFile.__dict__['version']

FAQ

  • Why do I need to copy the name and version attributes from the base class?

    Conan parses the recipe looking for the name and version attributes, instead of just executing it. Thus, we must copy the attributes to move past that check.

    Further, these attributes are descriptors. Accessing them with dot notation, like CMakeConanFile.name, evaluates them against the class CMakeConanFile instead of your recipe, but they need the most derived type to work correctly.

  • Can I override some attributes?

    Yes. These base classes just provide default values.

You can’t perform that action at this time.