FortranCInterface
: FortranCInterface.cmake
This file defines the function create_fortran_c_interface. this function is used to create a configured header file that contains a mapping from C to a Fortran function using the correct name mangling scheme as defined by the current fortran compiler.
The function tages a list of functions and the name of a header file to configure.
This file also defines some helper functions that are used to detect the fortran name mangling scheme used by the current Fortran compiler.
test_fortran_mangling - test a single fortran mangling
discover_fortran_mangling - loop over all combos of fortran
name mangling and call test_fortran_mangling until one of them
works.
discover_fortran_module_mangling - try different types of
fortran modle name mangling to find one that works
this function tests a single fortran mangling. CODE - test code to try should define a subroutine called "sub" PREFIX - string to put in front of sub POSTFIX - string to put after sub ISUPPER - if TRUE then sub will be called as SUB DOC - string used in status checking Fortran ${DOC} linkage SUB - the name of the SUB to call RESULT place to store result TRUE if this linkage works, FALSE
if not.