Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake Error: mismatch for the compiler version between your conan profile

Tags:

c++

cmake

conan

I'm on MacOS.

This is my error :

CMake Error at build/conanbuildinfo.cmake:625 (message): Detected a mismatch for the compiler version between your conan profile settings and CMake:

Compiler version specified in your conan profile: 11.0

Compiler version detected in CMake: 12.0

Please check your conan profile settings (conan profile show [default|your_profile_name])

and here's my cmakefile:

   project(Babel)
cmake_minimum_required(VERSION 2.8.12)
add_definitions("-fPIC")

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

find_package(Qt5Widgets CONFIG REQUIRED)

file(GLOB_RECURSE BABEL_SRC PATH ./sources/*.cpp)

include_directories(${CMAKE_INCLUDE_PATH})
add_executable(babel ${BABEL_SRC})
target_link_libraries(babel ${CONAN_LIBS} Qt5::Widgets)

Thanks.

like image 355
Kiloris Avatar asked Sep 21 '20 08:09

Kiloris


People also ask

Why is CMake not working on my macOS?

I'm on MacOS. CMake Error at build/conanbuildinfo.cmake:625 (message): Detected a mismatch for the compiler version between your conan profile settings and CMake: Please check your conan profile settings (conan profile show [default|your_profile_name])

How do I update the Conan compiler?

You can update your default profile, go to your userhome ~/.conan/profiles/default and change compiler.version=11 for compiler.version=12. If you are using a Conan version older than 1.29.2, you need to upgrade, as Conan 1.29.2 adds also 12 to the available versions in the default settings (you can see this file in ~/.conan/settings.yml.

Why am I getting CMake error code 625 ( message)?

CMake Error at build/conanbuildinfo.cmake:625 (message): Detected a mismatch for the compiler version between your conan profile settings and CMake: Please check your conan profile settings (conan profile show [default|your_profile_name])

What is a Conan profile?

Conan profiles allow users to define a configuration set for things like the compiler, build configuration, architecture, shared or static libraries, etc. Conan, by default, will not try to detect a profile automatically, so we need to create one.


1 Answers

Apple-clang recently updated to version 12.0, but your default profile, created before, still contains version 11.0.

This error is good, it is protecting you from changing compiler version and not realizing binaries will be different.

You can update your default profile, go to your userhome ~/.conan/profiles/default and change compiler.version=11 for compiler.version=12.

If you are using a Conan version older than 1.29.2, you need to upgrade, as Conan 1.29.2 adds also 12 to the available versions in the default settings (you can see this file in ~/.conan/settings.yml. Editing this settings file and adding version 12 manually to the apple-clang versions can also work for this case.

like image 106
drodri Avatar answered Oct 11 '22 03:10

drodri