BUG: make the toolchain-prefix recognition work with prefixes which contain
dots (as in arm-unknown-nto-qnx6.3.0-gcc.exe), NAME_WE returns only up to the 6, instead of everything in front of the .exe Alex
This commit is contained in:
parent
7327037508
commit
3e6decf312
|
@ -43,14 +43,17 @@ IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||||
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
|
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
|
||||||
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||||
|
|
||||||
# if we have a gcc cross compiler, they have usually some prefix, like
|
# If we have a gcc cross compiler, they have usually some prefix, like
|
||||||
# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc
|
# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc .
|
||||||
# the other tools of the toolchain usually have the same prefix
|
# 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-"
|
||||||
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
|
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
|
||||||
IF (COMPILER_BASENAME MATCHES "^(.+-)g?as")
|
IF (COMPILER_BASENAME MATCHES "^(.+-)g?as(\\.exe)?$")
|
||||||
STRING(REGEX REPLACE "^(.+-)g?as" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}")
|
STRING(REGEX REPLACE "^(.+-)g?as(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}")
|
||||||
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as")
|
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as(\\.exe)?$")
|
||||||
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
|
|
||||||
INCLUDE(CMakeFindBinUtils)
|
INCLUDE(CMakeFindBinUtils)
|
||||||
|
|
|
@ -88,14 +88,17 @@ IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||||
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
|
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
|
||||||
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||||
|
|
||||||
# if we have a gcc cross compiler, they have usually some prefix, like
|
# If we have a gcc cross compiler, they have usually some prefix, like
|
||||||
# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc
|
# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc .
|
||||||
# the other tools of the toolchain usually have the same prefix
|
# 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-"
|
||||||
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME_WE)
|
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
|
||||||
IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc")
|
IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$")
|
||||||
STRING(REGEX REPLACE "^(.+-)g?cc" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}")
|
STRING(REGEX REPLACE "^(.+-)g?cc(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}")
|
||||||
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc")
|
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$")
|
||||||
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -91,11 +91,14 @@ ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||||
# if we have a g++ cross compiler, they have usually some prefix, like
|
# 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++
|
# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++
|
||||||
# the other tools of the toolchain usually have the same prefix
|
# 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-"
|
||||||
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME_WE)
|
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
|
||||||
IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+")
|
IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$")
|
||||||
STRING(REGEX REPLACE "^(.+-)[gc]\\+\\+" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}")
|
STRING(REGEX REPLACE "^(.+-)[gc]\\+\\+(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}")
|
||||||
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+")
|
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$")
|
||||||
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
|
|
||||||
# This block was used before the compiler was identified by building a
|
# This block was used before the compiler was identified by building a
|
||||||
|
|
Loading…
Reference in New Issue