Skip to main content

Generic Conan recipes for CMake and Python projects.

Project description

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.

Project details


Release history Release notifications

This version

0.2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for autorecipes, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size autorecipes-0.2.0-py3-none-any.whl (13.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size autorecipes-0.2.0.tar.gz (11.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page