Skip to content
Advertisement

Install conan package without requirements?

Is there a possibility to install a conan package without requirements? I build a metapackage, which only contains some configurations and depends on other binary packages in the requires section.

Now I want to access only the configurations w/out downloading all dependencies, Is there a possibility to do so?

conan download downloads a package, but won’t install it, e.g. there is no info, where it’s downloaded, conan install offers the --json option for that. It’s not configurable with -s, too.

Advertisement

Answer

Is there a possibility to install a conan package without requirements?

Yes, conan download command. It ignores settings.

conan download downloads a package, but won’t install it, e.g. there is no info, where it’s downloaded

Not really, it’s installed as equal in conan data folder. To obtain any package path, you can run conan info --paths (see info), but info command will download package dependencies.

You have few options:

  • Run conan downloadand copy what you need:
conan download spdlog/1.8.5@:ff8d59d47be9cd9bef245bc941640efed49089de -r conan-center
cp ${HOME}/.conan/data/spdlog/1.8.5/_/_/package/ff8d59d47be9cd9bef245bc941640efed49089de/licenses/LICENSE new_folder/LICENSE

SpdLog requires fmt package, but we don’t want to download it too. Thus, we can’t run conan install --paths

  • Run conan install -g deploy and copy what you need.
conan install spdlog/1.8.5@ -r conan-center -g deploy
cp spdlog/licenses/LICENSE new_folder/LICENSE

The deploy generator will download all dependencies, but they will be copied to the current folder too.

Also, partial download was requested some time ago: https://github.com/conan-io/conan/issues/6508, but was denied.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement