Search code examples
pythonconan

Overriding profile settings in Conan


I have a special problem. I'm creating a conan package for a Windows profile. However, I need some packages which are uploaded to the Artifactory using a Linux profile. This is fairly uncommon, as usually all components must be installed for the same profile. However, I can not change this as the Linux components are loaded by my software and transferred to a Linux computer where they are executed.

So is there a way to specify the profile for which I'd like to download a component from the artifactory inside a conan file?


Solution

  • Short answer: you can't do it from inside the conanfile.py.


    (As said in the question) You can do it using profiles or the command line. For example, if your project depends on boost and zlib and you need to mix different configurations you can do as follow:

    • Using profiles:

      [settings]
      os=Linux  # This will apply by default to all libraries
      boost:os=Windows
      zlib:os=Android
      ...
      
    • Command line:

      conan install <your/project> -s boost:os=Windows -s zlib:os=Android