Skip to content

Commit

Permalink
Use gcc major version for package installation.
Browse files Browse the repository at this point in the history
Closes conan-io#53.
  • Loading branch information
bilke committed Jan 4, 2018
1 parent 3e5410e commit 88b41ff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion conan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ function(conan_cmake_settings result)
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
list(GET VERSION_LIST 0 MAJOR)
list(GET VERSION_LIST 1 MINOR)
set(COMPILER_VERSION ${MAJOR}.${MINOR})
if(${MAJOR} GREATER 4)
set(COMPILER_VERSION ${MAJOR})
endif()

conan_cmake_detect_gnu_libcxx(_LIBCXX)
set(_SETTINGS ${_SETTINGS} -s compiler=gcc -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=${_LIBCXX})

set(_SETTINGS ${_SETTINGS} -s compiler=gcc -s compiler.version=${COMPILER_VERSION} -s compiler.libcxx=${_LIBCXX})
elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL AppleClang)
# using AppleClang
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
Expand Down

0 comments on commit 88b41ff

Please sign in to comment.