summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCXXCompiler.cmake
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2013-03-14 18:42:03 (GMT)
committerAlex Neundorf <neundorf@kde.org>2013-03-14 20:48:09 (GMT)
commit27e6f6ef398d3ccfc496b1ecedf2db89991be10d (patch)
tree1493187178e8795e3b9ab70e26e185afda564a73 /Modules/CMakeDetermineCXXCompiler.cmake
parentb3015862e547319bdc91fab5f28a366640ab50ea (diff)
downloadCMake-27e6f6ef398d3ccfc496b1ecedf2db89991be10d.zip
CMake-27e6f6ef398d3ccfc496b1ecedf2db89991be10d.tar.gz
CMake-27e6f6ef398d3ccfc496b1ecedf2db89991be10d.tar.bz2
TI compiler: add automatic detection of prefix and suffixes
The TI cross compilers are named e.g. cl6x or armcl, the accompanying strip and ar have the same prefixes/suffixes. Alex
Diffstat (limited to 'Modules/CMakeDetermineCXXCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index c128cfa..6f7e8f6 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -156,6 +156,14 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX)
if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
+ elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "TI")
+ # TI compilers are named e.g. cl6x, cl470 or armcl.exe
+ get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
+ if (COMPILER_BASENAME MATCHES "^(.+)?cl([^.]+)?(\\.exe)?$")
+ set(_CMAKE_TOOLCHAIN_PREFIX "${CMAKE_MATCH_1}")
+ set(_CMAKE_TOOLCHAIN_SUFFIX "${CMAKE_MATCH_2}")
+ endif ()
+
endif()
endif ()