summaryrefslogtreecommitdiff
path: root/Modules/CMakeDetermineCCompiler.cmake
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2013-03-14 19:42:03 +0100
committerAlex Neundorf <neundorf@kde.org>2013-03-14 21:48:09 +0100
commit27e6f6ef398d3ccfc496b1ecedf2db89991be10d (patch)
tree1493187178e8795e3b9ab70e26e185afda564a73 /Modules/CMakeDetermineCCompiler.cmake
parentb3015862e547319bdc91fab5f28a366640ab50ea (diff)
downloadcmake-27e6f6ef398d3ccfc496b1ecedf2db89991be10d.tar.gz
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/CMakeDetermineCCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 736fc8932c..d2220e09ec 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -158,6 +158,13 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX)
if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
+ elseif("${CMAKE_C_COMPILER_ID}" MATCHES "TI")
+ # TI compilers are named e.g. cl6x, cl470 or armcl.exe
+ get_filename_component(COMPILER_BASENAME "${CMAKE_C_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 ()