[Cmake-commits] [cmake-commits] alex committed CMakeDetermineASMCompiler.cmake 1.2 1.3 CMakeDetermineCCompiler.cmake 1.52 1.53 CMakeDetermineCXXCompiler.cmake 1.45 1.46
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu May 15 12:07:45 EDT 2008
Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv1666
Modified Files:
CMakeDetermineASMCompiler.cmake CMakeDetermineCCompiler.cmake
CMakeDetermineCXXCompiler.cmake
Log Message:
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
Index: CMakeDetermineASMCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineASMCompiler.cmake,v
retrieving revision 1.2
retrieving revision 1.3
diff -C 2 -d -r1.2 -r1.3
*** CMakeDetermineASMCompiler.cmake 21 Apr 2008 22:51:55 -0000 1.2
--- CMakeDetermineASMCompiler.cmake 15 May 2008 16:07:43 -0000 1.3
***************
*** 44,55 ****
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 (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")
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
--- 44,58 ----
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
! # 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)
! 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)
Index: CMakeDetermineCXXCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCXXCompiler.cmake,v
retrieving revision 1.45
retrieving revision 1.46
diff -C 2 -d -r1.45 -r1.46
*** CMakeDetermineCXXCompiler.cmake 25 Feb 2008 14:23:14 -0000 1.45
--- CMakeDetermineCXXCompiler.cmake 15 May 2008 16:07:43 -0000 1.46
***************
*** 92,100 ****
# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++
# the other tools of the toolchain usually have the same prefix
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
! GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME_WE)
! IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+")
! STRING(REGEX REPLACE "^(.+-)[gc]\\+\\+" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}")
! ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+")
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
--- 92,103 ----
# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++
# 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_CXX_COMPILER}" NAME)
! IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$")
! STRING(REGEX REPLACE "^(.+-)[gc]\\+\\+(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}")
! ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$")
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
Index: CMakeDetermineCCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCCompiler.cmake,v
retrieving revision 1.52
retrieving revision 1.53
diff -C 2 -d -r1.52 -r1.53
*** CMakeDetermineCCompiler.cmake 25 Feb 2008 14:23:14 -0000 1.52
--- CMakeDetermineCCompiler.cmake 15 May 2008 16:07:43 -0000 1.53
***************
*** 89,100 ****
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 (NOT _CMAKE_TOOLCHAIN_PREFIX)
! GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME_WE)
! IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc")
! STRING(REGEX REPLACE "^(.+-)g?cc" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}")
! ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc")
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
--- 89,103 ----
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
! # 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_C_COMPILER}" NAME)
! IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$")
! STRING(REGEX REPLACE "^(.+-)g?cc(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}")
! ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$")
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
More information about the Cmake-commits
mailing list