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

Change selected parameter out of default settings

Open iradization opened this issue 2 years ago • 1 comments

Hi,

I'm using Conan from cmake, and prior to Conan install I extract the default settings using this command :

conan_cmake_autodetect(settings)

After this line the output of settings is as follows :

build_type=Debugcompiler=apple-clangcompiler.version=13.1compiler.libcxx=libc++

I'd like to change the compiler.version from 13.1 to 13. what is the best way to do so (I'd rather avoid modify the string value of settings directly since the text is not delimiter by ; char.)

I've found out a way to use profile instead of default settings.

  conan_cmake_install(
    PATH_OR_REFERENCE
    ${GIT_TOPLEVEL}/cmakeIncludes/conan.py
    BUILD
    missing
    REMOTE
    conancenter
    PROFILE
    default)

However, I'd like to first override the compiler version in the default profile... something like conan profile update settings.compiler.version="13" default

but I want to do it using Conan... Thanks

iradization avatar Aug 10 '22 06:08 iradization

Hi @iradization, Thanks for reporting, I'm sorry but I don't completely understand your question, could you please try to explain a bit more of your desired use? Besides using PROFILE you can also pass the compiler.version in the SETTINGS argument in the conan_cmake_install function. I would recommend you to have different profiles for each platform so that you don't have to rely on the autodetection.

czoido avatar Sep 12 '22 14:09 czoido