[CMake] ccmake and fortran

Arjen Markus arjen.markus at wldelft.nl
Mon Aug 14 02:37:52 EDT 2006


bpwlist at cox.net wrote:

>Hi Alan,
>
>My knowledgebase of fortran lies with fixed format f77 fortran, so your right the solution below only works for fixed format Fortran.  There is currently nothing in the .l file  to set the <fixed_fmt> state, so the line:
>
><fixed_fmt>^[cC*dD].*\n { return EOSTMT; } 
>
>never gets triggered.  Having only worked with fixed format fortran and not having a newer fortran book on my book shelf... How does the compiler determine whether a file is fixed or free format?  A test needs to be put in the .l file to determine whether fixed or free format fortran is being used.
>  
>
All Fortran compilers I know of use two methods to select between free 
form or fixed form source:
- The extension of the file (.f and .for are used for fixed form, .f90 
for free form)
- A command-line option which tells the compiler to ignore the first 
rule and accept
  the source file as either fixed form or free form.

That said, similar rules could be adopted for CMake. (Of course the 
command-line option
makes it a bit awkward, but then anybody who wants to use that will 
somehow have
to specify that he/she wants that anyway)

Regards,

Arjen



More information about the CMake mailing list