Shipping conan projects
See original GitHub issueI’ve been wondering how to ship binaries that are built with Conan. My constraints are that clients can’t use Conan on their machine to install my software (for various reasons) so I need to be able to generate a self contained archive with all the required dependencies. Basically for a conan project that means all its binaries plus all the binaries from its dependencies. (I consider that all “external” dependencies are “system” libraries that will be available on client machines)
I’ve been studying two approaches for now:
- Use CMake’s
install()
directives. It works fine for the project itself but requires a lot of hacking to parse the various variables from theconanbuild.cmake
file and extract the list of the.so
of.dll
files needed from the dependencies. - Have Conan do it for me. I was thinking about reusing the code of
conan install
to recursively execute thepackage
step of each project in the dependency tree with the same target directory. That way I should be able to deploy all the files into a common directory and zip/tar it.
I’d also be interested in a way to filter out the “dev” files from the packages (like the headers and static libraries) so that I only get executables and required runtime libraries.
My best idea so far would be an optional dev
tag that can be used by package maintainers when defining the package()
step to conditionally include the .h
and .a
/.lib
files. I’ve thought about scopes but there’s already a dev
scope that means something else.
Did you guys ever give some thought about this?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:10 (8 by maintainers)
I’ve found some docs on
imports
feature: https://docs.conan.io/en/latest/reference/conanfile/methods.html#imports https://docs.conan.io/en/latest/using_packages/conanfile_txt.html#imports https://docs.conan.io/en/latest/reference/commands/misc/imports.htmlI think deploy fits the use case nicely. I am closing this as solved. As this from long time ago and scopes no longer exist, please open a new issue if needed. Thanks!