Closed csteenwyk closed 2 years ago
The cmake_multi
generator needs first to install both debug an release packages, then it will use both of them. I am not a big fan of this generator, specially for packages, it might make some more sense for end consumers.
So you should do something like:
$ conan install ./conan_install --generator cmake_multi
$ conan install ./conan_install --generator cmake_multi -s compiler="Visual Studio" -s compiler.runtime=MDd -s build_type=Debug
or maybe better use profiles instead of those long command line arguments. That will create 3 files for you, then you could launch your cmake.
You might find further details in: http://docs.conan.io/en/latest/integrations/cmake/cmake_multi_generator.html#cmake-multi-generator
Regarding the --all, yes, it is only useful for downloading all variants for a given package, but not for the whole dependency graph. The reason is that it is used for the use case when you want to do a copy or a promotion (copy packages from one user/channel to another user/channel). But in terms of install, it would be totally overkill (for example, --all for the libzmq package I am preparing will retrieve 124 different binaries for Windows/Linux/OSX, which doesn't make sense, unless you want to do a bulk operation on them, like a promotion)
A very good point about the --all being overkill. I was hoping to avoid having to specifically call out all the options I wanted to control, but it sounds like there isn't really a better way.
It depends on what you want to do. If you want to always have debug/release multi-configuration packages, maybe you can be interested in creating your own multi-config packages: http://docs.conan.io/en/latest/packaging/package_info.html#multi-configuration-packages
The thing is that conan is optimized for being efficient and secure, by default only retrieving what you need. That helps for example to avoid Debug artifacts being leaked out (as they can be more easily reverse-engineered). That would be lost if using cmake_multi
for creating packages, and not only for end-user consumer convenience.
If you tell me about the options and the problem you want to manage, maybe I could try to figure out something (feel free to write an email if you have confidential info). Thanks!
cmake_multi
obsolete. Use CMakeDeps
instead.
HI,
I am trying to install the dependencies for a project using my conanfile.py file. My project uses cmake as its build system so I use the cmake_multi generator for the install line.
The issue I am having is best illustrated through an example:
conan install ./conan_install --generator cmake_multi
cmake -H. -Bbin -G"VIsual Studio 14 2015 Win64"
In this situation the conan "install" command will use the system default options for the dependent packages to install from conan.conf. Unfortunately if in my VIsual Studio project I switch from the "Release" build to the "Debug" build I get link errors because the default build_type option within conan.conf was "Release" and the debug version did not install.
Rather, I would like to install all variants of the package using the following:
conan install ./conan_install --generator cmake_multi --all
This would install all the packages so regardless of how I configure my visual studio project it will still work properly.
The --all option works if you pass in an explicit package option, but not if you pass in a file reference.
Unless you have any other suggestions.