Open
Description
To switch a compiler option for specifying the Fortran standard, CMake processes the following statements:
add_compile_options(-warn declarations,general,usage,interfaces,unused)
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
add_compile_options(-stand f15)
else()
add_compile_options(-stand f18)
endif()
The version comparison operator VERSION_LESS
used here corresponds to <
, so -stand f18
is specified for Intel Fortran 18.0 and later. However, Intel Fortran 18 does not have the keyword f18
for -stand
option.
It can be confirmed from references:
- 18.0 Fortran Compiler Developer Guide and Reference
- 19.0 Fortran Compiler Developer Guide and Reference
I found a version comparison operator VERSION_LESS_EQUAL
corresponding to <=
.
It would be better to use it instead of VERSION_LESS
.
add_compile_options(-warn declarations,general,usage,interfaces,unused)
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS_EQUAL 18.0)
add_compile_options(-stand f15)
else()
add_compile_options(-stand f18)
endif()