diff options
author | Alex Neundorf <neundorf@kde.org> | 2013-03-14 18:32:15 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2013-03-14 20:47:38 (GMT) |
commit | 7baa55ac0b79854238b3fb70c95501d8dcb8cb69 (patch) | |
tree | 336d256451e9496501011014ef25d3454a9bdfe9 /Modules/CMakeDetermineCXXCompiler.cmake | |
parent | 55812ab0bcf8655473535c05865a63772fbf6dac (diff) | |
download | CMake-7baa55ac0b79854238b3fb70c95501d8dcb8cb69.zip CMake-7baa55ac0b79854238b3fb70c95501d8dcb8cb69.tar.gz CMake-7baa55ac0b79854238b3fb70c95501d8dcb8cb69.tar.bz2 |
Determine C/CXX/Fortran compiler: minor restructuring
No functional changes, only change the way the if()-condition works,
to make it easier to add more cases.
Alex
Diffstat (limited to 'Modules/CMakeDetermineCXXCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 59da3e6..3523f8d 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -141,9 +141,11 @@ endif () # 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 (CMAKE_CROSSCOMPILING - AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" - AND NOT _CMAKE_TOOLCHAIN_PREFIX) + + +if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) + + if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) @@ -154,6 +156,7 @@ if (CMAKE_CROSSCOMPILING if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) endif () + endif() endif () |