cmake-conan icon indicating copy to clipboard operation
cmake-conan copied to clipboard

Add --conf arguments for `conan install` command.

Open hwhsu1231 opened this issue 1 year ago • 7 comments

Add the following arguments of conan install command:

  • --conf
  • --conf:host
  • --conf:build

for conan_cmake_install() function.

hwhsu1231 avatar Sep 17 '22 08:09 hwhsu1231

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 17 '22 08:09 CLAassistant

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!

hwhsu1231 avatar Sep 19 '22 10:09 hwhsu1231

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.

czoido avatar Sep 19 '22 10:09 czoido

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.

image

hwhsu1231 avatar Sep 19 '22 10:09 hwhsu1231

@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?

hwhsu1231 avatar Sep 19 '22 13:09 hwhsu1231

@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 avatar Sep 19 '22 14:09 czoido

@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.

hwhsu1231 avatar Oct 12 '22 07:10 hwhsu1231

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.

czoido avatar Oct 26 '22 10:10 czoido