summaryrefslogtreecommitdiff
path: root/Tests/Fortran
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-10-14 10:25:32 -0400
committerBen Boeckel <ben.boeckel@kitware.com>2014-10-20 11:49:16 -0400
commit29c3edb87adedd82e816552d958f4c3540a1511b (patch)
tree089cea993a6c212b2107554eeca443e48993ca08 /Tests/Fortran
parenta7596fef6e8d6938ce0d7fcba47e896f288b12b4 (diff)
downloadcmake-29c3edb87adedd82e816552d958f4c3540a1511b.tar.gz
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 'Tests/Fortran')
-rw-r--r--Tests/Fortran/CMakeLists.txt18
1 files changed, 9 insertions, 9 deletions
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index 1982a6025f..8700c9466f 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -13,11 +13,11 @@ message("CMAKE_Fortran_COMPILER = ${CMAKE_Fortran_COMPILER}")
message("CMAKE_Fortran_FLAGS = ${CMAKE_Fortran_FLAGS}")
set(_SHARED SHARED)
-if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "^(XL|VisualAge)$")
+if(CMAKE_Fortran_COMPILER_ID MATCHES "^(XL|VisualAge)$")
# We do not implement SHARED Fortran libs on AIX yet!
# Workaround: Set LINKER_LANGUAGE to C, which uses 'xlc' and Fortran implicits.
set(_SHARED STATIC)
-elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")
+elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
# g77 2.96 does not support shared libs on Itanium because g2c is not -fPIC
execute_process(COMMAND ${CMAKE_Fortran_COMPILER} --version
OUTPUT_VARIABLE output ERROR_VARIABLE output)
@@ -29,10 +29,10 @@ endif()
# Pick a module .def file with the properly mangled symbol name.
set(world_def "")
if(WIN32 AND NOT CYGWIN)
- if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
+ if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(world_def world_gnu.def)
- elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel" OR
- "${CMAKE_GENERATOR}" MATCHES "Visual Studio") # Intel plugin
+ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel" OR
+ CMAKE_GENERATOR MATCHES "Visual Studio") # Intel plugin
set(world_def world_icl.def)
endif()
endif()
@@ -119,7 +119,7 @@ endfunction()
# call the test_fortran_c_interface_module function
if("${CMAKE_Fortran_COMPILER_ID}:${CMAKE_C_COMPILER_ID}" MATCHES
"(Intel:MSVC|Absoft:GNU)"
- OR ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "${CMAKE_C_COMPILER_ID}" ))
+ OR (CMAKE_Fortran_COMPILER_ID MATCHES CMAKE_C_COMPILER_ID ))
test_fortran_c_interface_module()
else()
message("Fortran does not match c compiler")
@@ -128,7 +128,7 @@ else()
# hack to make g77 work after CL has been enabled
# as a languge, cmake needs language specific versions
# of these variables....
- if(WIN32 AND "${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
+ if(WIN32 AND CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(CMAKE_CREATE_CONSOLE_EXE )
set(CMAKE_LIBRARY_PATH_FLAG "-L")
set(CMAKE_LINK_LIBRARY_FLAG "-l")
@@ -137,8 +137,8 @@ else()
# gnu and sunpro do not use the same flags here...
# however if LDFLAGS is used to set -m64 it causes odd stuf
# with the fortran build
- if( ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
- AND ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "SunPro"))
+ if( (CMAKE_C_COMPILER_ID MATCHES "GNU")
+ AND (CMAKE_Fortran_COMPILER_ID MATCHES "SunPro"))
set(CMAKE_EXE_LINKER_FLAGS "")
set(CMAKE_Fortran_FLAGS "")
endif()