|
|
@@ -152,8 +152,9 @@ IF(NOT CMAKE_CXX_COMPILER_ID_RUN)
|
|
|
ENDIF(NOT CMAKE_CXX_COMPILER_ID_RUN)
|
|
|
|
|
|
# if we have a g++ cross compiler, they have usually some prefix, like
|
|
|
-# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++
|
|
|
-# the other tools of the toolchain usually have the same prefix
|
|
|
+# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ , optionally
|
|
|
+# with a 3-component version number at the end (e.g. arm-eabi-gcc-4.5.2).
|
|
|
+# The other tools of the toolchain usually have the same prefix
|
|
|
# NAME_WE cannot be used since then this test will fail for names lile
|
|
|
# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
|
|
|
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
|
|
|
@@ -161,9 +162,9 @@ IF (CMAKE_CROSSCOMPILING
|
|
|
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
|
|
|
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
|
|
|
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
|
|
|
- IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$")
|
|
|
+ IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
|
|
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
|
|
- ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$")
|
|
|
+ ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
|
|
|
|
|
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
|
|
|
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
|