[CMake] help with cmake fortran envar

Rolf Eike Beer eike at sf-mail.de
Tue Nov 16 13:57:26 EST 2010


Am Dienstag, 16. November 2010 schrieb luxInteg:
> Greetings,
> 
> I am learning cmake.
> 
> 
> I have a fortran only project with some  source files with f77 routines  to
> compile,  My CMakeLists.txt in the projects base directory   has the
> following lines
> 
> set(CMAKE_Fortran_COMPILER  gfortran)
> ENABLE_LANGUAGE(Fortran)
> 
> 
> ########  but running cmake ends like so:-
> 
> -- Checking whether /usr/bin/gfortran supports Fortran 90
> -- Checking whether /usr/bin/gfortran supports Fortran 90 -- yes
> CMake Error: Error required internal CMake variable not set, cmake may be
> not be built correctly.
> Missing variable is:
> CMAKE_FORTRAN_COMPILER_ENV_VAR
> CMake Error: Error required internal CMake variable not set, cmake may be
> not be built correctly.
> Missing variable is:
> CMAKE_FORTRAN_COMPILER
> CMake Error: Could not find cmake module file:
> $SOURCES/build/CMakeFiles/CMakeFORTRANCompiler.cmake
> CMake Error: Could not find cmake module file:CMakeFORTRANInformation.cmake
> CMake Error: CMAKE_FORTRAN_COMPILER not set, after EnableLanguage
> -- Configuring incomplete, errors occurred!
> 
> 
> 
> 
> #########
> 
> I have set
> FC="gfortran"       and
> FFLAGS="flags/I/use/to/compile/stuff"
> as envars so I am perplexed what the required envar is.
> 
> advice would be appreciated

Remove that stuff. Start your CMakeLists.txt with

PROJECT(foobar FORTRAN)

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101116/63107200/attachment-0001.pgp>


More information about the CMake mailing list