BUG: Fixed additional issues with autodetecting compiler tags properly including Issue #6926

This commit is contained in:
Philip Lowman 2009-01-18 17:19:54 -05:00
parent ee91442a90
commit f7ba5a7fc8
1 changed files with 15 additions and 9 deletions

View File

@ -477,11 +477,10 @@ ELSE (_boost_IN_CACHE)
set(_boost_COMPILER ${Boost_COMPILER}) set(_boost_COMPILER ${Boost_COMPILER})
if(Boost_DEBUG) if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"using user-specified _boost_COMPILER = ${_boost_COMPILER}") "using user-specified Boost_COMPILER = ${_boost_COMPILER}")
endif() endif()
else(Boost_COMPILER) else(Boost_COMPILER)
# Attempt to guess the compiler suffix # Attempt to guess the compiler suffix
SET (_boost_COMPILER "-gcc")
if (MSVC90) if (MSVC90)
SET (_boost_COMPILER "-vc90") SET (_boost_COMPILER "-vc90")
elseif (MSVC80) elseif (MSVC80)
@ -489,20 +488,27 @@ ELSE (_boost_IN_CACHE)
elseif (MSVC71) elseif (MSVC71)
SET (_boost_COMPILER "-vc71") SET (_boost_COMPILER "-vc71")
elseif (MSVC70) # Good luck! elseif (MSVC70) # Good luck!
SET (_boost_COMPILER "-vc70") SET (_boost_COMPILER "-vc7") # yes, this is correct
elseif (MSVC60) # Good luck!
SET (_boost_COMPILER "-vc6") # yes, this is correct
elseif (BORLAND)
SET (_boost_COMPILER "-bcb")
elseif("${CMAKE_CXX_COMPILER}" MATCHES "icl")
if(WIN32)
set (_boost_COMPILER "-iw")
else()
set (_boost_COMPILER "-il")
endif()
elseif (MINGW) elseif (MINGW)
EXEC_PROGRAM(${CMAKE_CXX_COMPILER} EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
ARGS -dumpversion ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE _boost_COMPILER_VERSION OUTPUT_VARIABLE _boost_COMPILER_VERSION
) )
STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
_boost_COMPILER_VERSION ${_boost_COMPILER_VERSION}) _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
elseif (UNIX) elseif (UNIX)
IF (NOT CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCC)
# We assume that we have the Intel compiler.
SET (_boost_COMPILER "-il")
ELSE (NOT CMAKE_COMPILER_IS_GNUCC)
# Determine which version of GCC we have. # Determine which version of GCC we have.
EXEC_PROGRAM(${CMAKE_CXX_COMPILER} EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
@ -529,7 +535,7 @@ ELSE (_boost_IN_CACHE)
ELSE() ELSE()
SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
ENDIF() ENDIF()
ENDIF (NOT CMAKE_COMPILER_IS_GNUCC) endif (CMAKE_COMPILER_IS_GNUCC)
endif() endif()
if(Boost_DEBUG) if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "