cmake-conan
cmake-conan copied to clipboard
Add --conf arguments for `conan install` command.
Add the following arguments of conan install command:
--conf--conf:host--conf:build
for conan_cmake_install() function.
Hello @memsharded or @czoido,
Recently, I found an ALTERNATIVE way to use cmake-conan, which can successfully use CMakeToolchain generator. However, I met a problem which need to add the following argument in conan install command:
--conf tools.cmake.cmaketoolchain:generator="Ninja Multi-Config"
Therefore, I posted this PR to add CONF, CONF_HOST, and CONF_BUILD arguments for conan_cmake_install() function. Can you check whether this PR can be merged? Thanks a lot!
Hi @hwhsu1231, Thanks a lot for contributing this, it's looking good, let's check if the ci passes. Did you tests it locally? Adding at least one test would be nice.
Yes. I prepared a modified conan.cmake locally and copied it to the build directory instead of downloading from the repository. And it worked as I expected.

@czoido Execuse me. What do you mean "Adding at least one test would be nice."? Where do I need to add the test? What kind of test should I add?
@czoido Execuse me. What do you mean "Adding at least one test would be nice."? Where do I need to add the test? What kind of test should I add?
I meant adding it here: https://github.com/conan-io/cmake-conan/blob/develop/tests.py but don't worry about that, I'll update the branch with a test.
@czoido Recently, I'm trying an alternatvie way to use cmake-conan. And this argument --conf is necessary for CMakeToolchain to generate a proper conan_toolchain.cmake. Hope this PR can be merged as soon as possible.
Hi @hwhsu1231, I have just pushed a test for this feature, it will be merged for 0.19 release as soon as the ci passes.