Conan Profile

Yesterday I upgrade macOS and then upgraded Xcode. This meant that I went from using apple-clang 9.1 to using apple-clang 10.0. When I tried a fresh build of my CMake project using Conan, I got the following error:

CMake Error at /Users/user/build/conanbuildinfo.cmake:588 (message):
  Incorrect 'apple-clang' version 'compiler.version=9.1' is not the one
  detected by CMake: 'Clang=10.0'
Call Stack (most recent call first):
  /Users/user/build/conanbuildinfo.cmake:645 (conan_error_compiler_version)
  /Users/user/build/conanbuildinfo.cmake:716 (check_compiler_version)
  /Users/user/build/conanbuildinfo.cmake:353 (conan_check_compiler)
  CMakeLists.txt:33 (conan_basic_setup)

After looking at conan --help I soon realized the profile command.

> conan profile list
default
> conan profile show default
Configuration for profile default:

[settings]
os=Macos
os_build=Macos
arch=x86_64
arch_build=x86_64
compiler=apple-clang
compiler.version=9.1
compiler.libcxx=libc++
build_type=Release
[options]
[build_requires]
[env]

And there it was, Conan was still configured to the old compiler version. After a few tries I was finally able to update the compiler:

> conan profile update settings.compiler.version=10.0 default
> conan profile show default
Configuration for profile default:

[settings]
os=Macos
os_build=Macos
arch=x86_64
arch_build=x86_64
compiler=apple-clang
compiler.version=10.0
compiler.libcxx=libc++
build_type=Release
[options]
[build_requires]
[env]

Once I updated the packages I needed to (some only had 9.1 versions), I was able to CMake and build just fine.