[CMake] ccmake and fortran
William A. Hoffman
billlist at nycap.rr.com
Tue Aug 15 12:49:21 EDT 2006
At 11:48 AM 8/15/2006, bpwlist at cox.net wrote:
>---- Brad King <brad.king at kitware.com> wrote:
>>
>> FYI, there is a bug report for this problem:
>>
>> http://www.cmake.org/Bug/bug.php?op=show&bugid=3109
>>
>> I briefly looked at fixing it but got stuck on the free-format versus
>> fixed-format parsing. Unfortunately I have no time for this bug now.
>>
>> Please add any conclusion for this discussion to that bug report.
>>
>
>Brad,
>
>I played around with it a bit this weekend.
>
>Something like this could be done in cmDependsFortranLexer.in.l
>
>...
>
>%option reentrant
>%option noyywrap
>%pointer
>
>%s free_fmt fixed_fmt
>%x str_sq str_dq
>
>%%
>
>%{
> bool fixed = cmDependsFortranParser_isFixedFormat(yyextra);
> if (fixed)
> BEGIN(fixed_fmt);
>%}
>
>\" {
> cmDependsFortranParser_StringStart(yyextra);
> BEGIN(str_dq);
>}
>
>...
>
>!.*\n { return EOSTMT; } /* Treat comments like */
><fixed_fmt>^[cC*dD].*\n { return EOSTMT; } /* empty lines */
>
>cmDependsFortranParser_isFixedFormat would be a function that we could add to
>cmDependsFortran.cxx which returnss true if a given file is fixed format. The question really becomes: How does cmDependsFortranParser_isFixedFormat determine whether the file is fixed or free format? I believe I could add a check for the file extension fairly easily. Adding a check for command line flags or to see whether SET_SOURCE_FILE_PROPERTIES(FORTRAN_FIXED_FORMAT) (as Alan suggested) looks to be more involved, as cmDependsFortran or the parser does not appear to be plumbed to access that type of information.
>
>If I submiited a patch with the changes to the parser and a cmDependsFortranParser_isFixedFormat function that is based on file extension, could we get it incoporated? We could then worry about more robust ways about determining if a file is free or fixed format later.
Will the change I just checked into CVS work for you?
-Bill
More information about the CMake
mailing list