[CMake] What's the best way to support additional compilers for an "official" CMake language such as Fortran

Brad King brad.king at kitware.com
Tue Jan 26 08:37:14 EST 2010


Arjen Markus wrote:
> I tried to do this, using the Compaq Visual Fortran compiler as a test
> case, as I can do that rightaway, but I ran into some trouble:

Okay, I didn't expect this one to work yet.

The MinGW and Cygwin versions of gfortran should work though.
Please confirm this when you get a chance.

> - CMake complained at first about f90 - the -o option is ambiguous IIRC

Without the Compaq compiler info files CMake has no idea how to construct
the compiler command line, so it guesses with unix conventions.  This is
not surprising.

> - There were no output files created in the working directory, but there
>   was a message that all was fine.

What was the actual CMake output log?

> - I tried to reproduce the error messages, but CMake reacts differently
>   now: there is no indication it is trying to find a Fortran compiler,
>   and it is finished very fast indeed.
> 
> Is it storing the cached information in another location than the
> current (working) directory? If so, which is it?

There is also a CMakeFiles subdirectory in which compiler information
is kept outside of CMakeCache.txt so that it can be shared with the
try_compile projects.  Generally you should keep the source tree totally
clean and always use outside build trees.  That way you can just wipe
out the build tree to start fresh.

-Brad


More information about the CMake mailing list