cmake check_fortran_source_compiles examples

Signatures

check_fortran_source_compiles(<code> <resultVar>
  [FAIL_REGEX <regex>...]
  [SRC_EXT <extension>]
)

Examples

v6d-io/v6d cmake/CheckLinkerFlag.cmake :80

check_Fortran_source_compiles("${_source}" ${_var} ${_common_patterns})

Amber-MD/cpptraj cmake-cpptraj/CheckLinkerFlag.cmake :44

check_fortran_source_compiles(
			"program test
			print *, \'Hello, world\'
			end program test" 
			${RESULT}
			# Some compilers do not fail with a bad flag
			FAIL_REGEX "command line option .* is valid for .* but not for Fortran" # GNU
			${_CheckLinkerFlag_COMMON_PATTERNS})

InsightSoftwareConsortium/ITK Modules/ThirdParty/HDF5/src/itkhdf5/config/cmake/HDF5UseFortran.cmake :80

check_fortran_source_compiles (${SOURCE_CODE} FORTRAN_HAVE_C_LONG_DOUBLE SRC_EXT f90)

ornladios/ADIOS2 cmake/ADIOSFunctions.cmake :215

CHECK_Fortran_SOURCE_COMPILES([[
module foo
  interface bar
    module subroutine bar_integer(x)
      integer, intent(in) :: x
    end subroutine
    module subroutine bar_real(x)
      real, intent(in) :: x
    end subroutine
  end interface
end module
submodule ( foo ) sub
contains
  module subroutine bar_integer(x)
    integer, intent(in) :: x
  end subroutine
  module subroutine bar_real(x)
    real, intent(in) :: x
  end subroutine
end submodule
program main
end program
]] ${var} SRC_EXT F90)

INET-RC/GeoMX 3rdparty/openmp/runtime/cmake/LibompCheckFortranFlag.cmake :26

check_fortran_source_compiles("${fortran_source}" ${boolean} FAIL_REGEX "${failed_regexes}")

Tencent/Forward source/third_party/hdf5/config/cmake/HDF5UseFortran.cmake :82

check_fortran_source_compiles (${SOURCE_CODE} FORTRAN_HAVE_C_LONG_DOUBLE SRC_EXT f90)

llvm-mirror/openmp runtime/cmake/LibompCheckFortranFlag.cmake :25

check_fortran_source_compiles("${fortran_source}" ${boolean} FAIL_REGEX "${failed_regexes}")

Lewuathe/mlir-hello thirdparty/llvm-project/openmp/runtime/cmake/LibompCheckFortranFlag.cmake :26

check_fortran_source_compiles("${fortran_source}" ${boolean} FAIL_REGEX "${failed_regexes}")

parflow/parflow CMakeLists.txt :434

CHECK_Fortran_SOURCE_COMPILES("      program main
      implicit none
      write ( *, '(a)' ) '  Hello, world!'
      stop
      end" FORTRAN_77_WORKS)

bbrister/SIFT3D cmake/FindOpenMP.cmake :338

check_fortran_source_compiles("${OpenMP_Fortran_TEST_SOURCE}" OpenMP_FLAG_DETECTED)

HDFGroup/hdf5 config/HDF5UseFortran.cmake :98

check_fortran_source_compiles (${SOURCE_CODE} FORTRAN_HAVE_C_LONG_DOUBLE SRC_EXT f90)

merzlab/QUICK cmake/CheckLinkerFlag.cmake :44

check_fortran_source_compiles(
			"program test
			print *, \'Hello, world\'
			end program test" 
			${RESULT}
			# Some compilers do not fail with a bad flag
			FAIL_REGEX "command line option .* is valid for .* but not for Fortran" # GNU
			${_CheckLinkerFlag_COMMON_PATTERNS})