diff --git a/CMakeLists.txt b/CMakeLists.txt index 9be0a9c..424ac35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,12 +23,16 @@ message(STATUS "Using: if (NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) message(WARNING "The file conanbuildinfo.cmake doesn't exist, running conan install.") - string(REPLACE "." ";" VERSION_LIST "${CMAKE_CXX_COMPILER_VERSION}") - list(GET VERSION_LIST 0 MAJOR) + string(REPLACE "." ";" VERSION_LIST "${CMAKE_C_COMPILER_VERSION}") + list(GET VERSION_LIST 0 VERSION) + list(GET VERSION_LIST 1 MINOR) + if (NOT MINOR MATCHES 0) + SET(VERSION ${VERSION}.{MINOR}) + endif() if (NOT WINDOWS) - execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build missing -s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=${MAJOR}) + execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build missing -s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION}) else() - execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build missing -s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=${MAJOR}) + execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build missing -s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION}) endif() endif () include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)