conan icon indicating copy to clipboard operation
conan copied to clipboard

[question] How to package application with conan installed dependencies together?

Open aiyolo opened this issue 1 year ago • 1 comments

What is your question?

I want to make a installer for my application that will need some dll files installed by conan.

I known that conan will install dependencies to .conan folder, but how I can I copy the all the dependent *dll file to a customed folder when I run cmake --build --preset release --target install ?

Is there a recommended practice?

Have you read the CONTRIBUTING guide?

  • [ ] I've read the CONTRIBUTING guide

aiyolo avatar Jun 05 '24 15:06 aiyolo

Hi @aiyolo

Yes, there are some recommended practices:

  • deployers can be used as a generic mechanism to extract files from the conan cache and copy them to your local folder so you can create installers from them: https://docs.conan.io/2/reference/extensions/deployers.html#deployers
  • You can also create your custom commands that do your own logic, you might even automate the creation of your installer in a Conan custom command: https://docs.conan.io/2/reference/extensions/custom_commands.html
  • These are conan commands, no cmake commands. If you want to automate something from the CMake side, you might use https://docs.conan.io/2/reference/tools/cmake/cmaketoolchain.html#conan-runtime-lib-dirs

memsharded avatar Jun 05 '24 16:06 memsharded

Any further question here @aiyolo ? Maybe the ticket can be closed?

memsharded avatar Sep 04 '24 21:09 memsharded

Any further question here @aiyolo ? Maybe the ticket can be closed?

Thanks for your reply!I had tried the deployer option. I hope more example around this option can be added into official site.

aiyolo avatar Sep 08 '24 11:09 aiyolo