diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-10-14 14:25:32 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2014-10-20 15:49:16 (GMT) |
commit | 29c3edb87adedd82e816552d958f4c3540a1511b (patch) | |
tree | 089cea993a6c212b2107554eeca443e48993ca08 /Modules/CMakeDetermineFortranCompiler.cmake | |
parent | a7596fef6e8d6938ce0d7fcba47e896f288b12b4 (diff) | |
download | CMake-29c3edb87adedd82e816552d958f4c3540a1511b.zip CMake-29c3edb87adedd82e816552d958f4c3540a1511b.tar.gz CMake-29c3edb87adedd82e816552d958f4c3540a1511b.tar.bz2 |
Avoid if() quoted auto-dereference
When testing CMAKE_<LANG>_COMPILER_ID values, do not explicitly
dereference or quote the variable. We want if() to auto-dereference the
variable and not its value. Also replace MATCHES with STREQUAL where
equivalent.
Diffstat (limited to 'Modules/CMakeDetermineFortranCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineFortranCompiler.cmake | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index 96df6a2..a4bb86c 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -152,12 +152,12 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN) endif() # Set old compiler and platform id variables. - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") set(CMAKE_COMPILER_IS_GNUG77 1) endif() - if("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW") + if(CMAKE_Fortran_PLATFORM_ID MATCHES "MinGW") set(CMAKE_COMPILER_IS_MINGW 1) - elseif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin") + elseif(CMAKE_Fortran_PLATFORM_ID MATCHES "Cygwin") set(CMAKE_COMPILER_IS_CYGWIN 1) endif() endif() @@ -175,7 +175,7 @@ endif () # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") get_filename_component(COMPILER_BASENAME "${CMAKE_Fortran_COMPILER}" NAME) if (COMPILER_BASENAME MATCHES "^(.+-)g?fortran(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) |