Search code examples
pythonc++package-managersconan

When creating a Conan package, how can I export a package consumer conan recipe?


I would like to know how to export a Conan recipe to be used by the consumer (which, among other things, will build the package from source and install the binaries in specific directories in the system) instead of the one I used to create the package.

I've been reading this section on Conan official documentation:

https://docs.conan.io/en/latest/mastering/conanfile_py.html#

but I don't seem to understand exactly how it works.


Solution

  • After running 'conan create' command, I used 'conan export' command with the following arguments:

    conan export <consumer_conan_recipe> <package_name> -ks
    

    where -ks prevents the command from removing the source folder in the local cache, even if the recipe changed (source: 'conan export --help' command)