[CMake] 1 tricky question, 1 bug report

Brad King brad.king at kitware.com
Mon Mar 16 09:24:19 EDT 2009


Maik Beckmann wrote:
> The _second_ option proposed in the book is to have two distinct fortran 
> lexers (and probably two parsers).  This is the cleanest solution, but would 
> be engineered for this special problem, IMHO. 

Fixed and free format are practically two different languages from the parsing
perspective, so I would not be against this solution.  It is more work though.

As I stated in my previous response, the current fixed_fmt code is never used
because CMake does not know how to tell apart free and fixed format files.  I
do not think the file extension is a reliable indicator, but can perhaps be a
heuristic to guess and try one parser first followed by the other if it fails.
Otherwise we will need to require users to set source file properties to
indicate the format of each source :(

> The _third_ option is to make the lexer format agnostic and handle formats at 
> the parser code.  This should work well, since we just have to make sure that 
> the valid MODULE und USE statements are catched.  Remeber, so far the free 
> format code processes fixed format code proper most of time.

What happens if a 'C' appears at the beginning of a non-comment line in free
format?  If it appears on a module line then the build might break because
ordering among source files may be broken.

-Brad


More information about the CMake mailing list