Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Environmental" means to choose PROFILE_BUILD and PROFILE_HOST #323

Open
puetzk opened this issue Mar 7, 2021 · 1 comment
Open

"Environmental" means to choose PROFILE_BUILD and PROFILE_HOST #323

puetzk opened this issue Mar 7, 2021 · 1 comment

Comments

@puetzk
Copy link
Contributor

puetzk commented Mar 7, 2021

For the stock PROFILE, conan has a CONAN_DEFAULT_PROFILE_PATH environment variable. But this does not provide a way to do many newer conan features, like multiple profiles, or --profile:host vs --profile:build. And it's my understanding (per discussion in conan-io/conan#6476) that this is something conan itself would like to move away from in the future, so there's little appetite to add more to it.

I'd like to still see some way for IDE configurations like Qt Creator "kits", visual studio's CMakeSettings.json configurations, a custom Toolchain file, or the cmake-presets (new in 3.20) to influence the default settings/profiles used by conan_cmake_install (in general, the PROFILE_* arguments don't really make sense to hardcode into a CMakeLists.txt, since the same project is usable on many different platforms). So another idea that seems reasonable would be to have some CONAN_* CMake variables, which could be preset cache variables, set by the IDE or from a toolchain file) paralleling a lot of the non-project arguments of `conan_cmake_install

I'd propose (at least) the following as settings that a project often wouldn't know, but a preset might be able to usefully supply:
CONAN_COMMAND
CONAN_GENERATORS
CONAN_PROFILE, CONAN_PROFILE_HOST, CONAN_PROFILE_BUILD
CONAN_SETTINGS CONAN_SETTINGS_HOST, CONAN_SETTINGS_BUILD,

or prehaps these could be CONAN_DEFAULT_*, or whatever other naming scheme is preferred. These would all basically just be treated as defaults that could still be appended to (or in the case of CONAN_COMMAND, overwritten) by anything passed through conan_parse_arguments.

Admittedly, I previously filed #185 reporting one variable (CONAN_GENERATORS) that already works like this, seemingly by accident, just because the code appends without overwriting. But if intentional and documented, I think it might be a good way to get this information in without having to edit each project file to least each combination of settings it might be built with, and instead of be able to supply the conan profile used to resolve dependencies in the same place as the preset that supplied the CMAKE_TOOLCHAIN_FILE and such configuration for the consumer.

@puetzk
Copy link
Contributor Author

puetzk commented Mar 7, 2021

Perhaps related to #307, though @uyha was more willing/able to just forward a few variables and let it re-autodetect the rest (that wouldn't work for all cases, but it's enough for simple ones where the profile/toolchain file aren't doing much more than providings settings.arch and a prefixed compiler).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant