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

Add CONAN_INSTALL_ARGS variable #612

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

jcar87
Copy link
Contributor

@jcar87 jcar87 commented Jan 22, 2024

  • Add CONAN_INSTALL_ARGS cmake variable to control arguments passed to conan install - with some caveats, see documentation.

@jcar87 jcar87 requested a review from memsharded January 22, 2024 10:55
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect

### Customizing the invocation of Conan install
The CMake-Conan dependency provider will autodetect and pass the profile information as described above. If the `conan install` command invocation needs to be customized further, the `CONAN_INSTALL_ARGS` variable can be used.
* By default, `CONAN_INSTALL_ARGS` is initialised to pass `--build=missing`. If you customize this variable, please be aware that Conan will revert to its default behaviour unless you specify the `--build` flag.
* Two arguments are reserved to the dependency provider implementation and must not be set: the path to a `conanfile.txt|.py`, and the output format (`--format`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe recall that the --profile argument is also reserved to the provider?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, although that wasn't my initial intention since the --profile flags are/ can be additive and still work/. If they are passed via CONAN_INSTALL_ARGS they'll be appended - presumably without causing errors in the invocation itself, although this is very "you better know what you're doing" territory. Presumably you can "blank" the two CONAN_HOST_PROFILE_* variables, and handle it all with this flag instead.

On the other hand, the path to the conanfile and the --format flags would always be incompatible and cause an error if one tries to define them here.

@jcar87 jcar87 marked this pull request as ready for review January 30, 2024 09:35
@jcar87 jcar87 merged commit a3015db into conan-io:develop2 Jan 30, 2024
5 checks passed
@jcar87 jcar87 deleted the lcc/feature/conan-install-args branch January 30, 2024 09:36
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

Successfully merging this pull request may close these issues.

2 participants