Search code examples
conan

Is there a way to manage multi config projects with conan


We have project we mainly develop with windows and use conan to manage external dependencies (including non-open-source dependencies).

The global project configuration is based on cmake and our main IDE is Visual Studio 2019 that is multi config (we can switch between Release and Debug for example, this is well supported by cmake).

The only reason why we cannot use multi config feature of visual studio is because of conan. Maybe it is just that we do not use it correctly?

In the conan install command, we specify the build type, for example conan install path/to/conanfile.txt -s build_type=Debug, and so conan install and generate cmake helper files for Debug only. If I switch to Release mode in Visual Studio, it does not work because installed and configured conan packages are not compatible with Release config, and even if there was it would use Debug version instead of Release version.

For the installation part we could simply run twice the conan install command... But conan generated files Findxxx.cmake refer to only one config.

Is there correct a way to manage multi config projects with conan?

Thank you


Solution

  • Technically conan can do multi config projects very well, depending on the used build system.

    You can find everything in the documentation. Please allow me give you some startup help.