diff options
author | Alexander Neundorf <neundorf@kde.org> | 2008-05-15 16:07:43 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2008-05-15 16:07:43 (GMT) |
commit | 3e6decf31205ecfcbe837c0d0344f4597aa33369 (patch) | |
tree | 53f86f9b97adecfefd551b29e852eb1942fe8954 /Modules/CMakeDetermineASMCompiler.cmake | |
parent | 7327037508bebd45cda415e9061501fb3f0723bc (diff) | |
download | CMake-3e6decf31205ecfcbe837c0d0344f4597aa33369.zip CMake-3e6decf31205ecfcbe837c0d0344f4597aa33369.tar.gz CMake-3e6decf31205ecfcbe837c0d0344f4597aa33369.tar.bz2 |
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
Diffstat (limited to 'Modules/CMakeDetermineASMCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineASMCompiler.cmake | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index 44bd234..eac8c55 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -43,14 +43,17 @@ IF (NOT _CMAKE_TOOLCHAIN_LOCATION) GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH) ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION) -# 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 -# the other tools of the toolchain usually have the same prefix +# 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 . +# 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) - GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE) - IF (COMPILER_BASENAME MATCHES "^(.+-)g?as") - STRING(REGEX REPLACE "^(.+-)g?as" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}") - ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as") + GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME) + IF (COMPILER_BASENAME MATCHES "^(.+-)g?as(\\.exe)?$") + STRING(REGEX REPLACE "^(.+-)g?as(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}") + ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as(\\.exe)?$") ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX) INCLUDE(CMakeFindBinUtils) |