[CMake] Fortran+CXX project with CMake 2.2.2

William A. Hoffman billlist at nycap.rr.com
Wed Nov 9 21:00:56 EST 2005


It should be :

PROJECT(add_fortran Fortran)

-Bill

At 07:27 PM 11/9/2005, Karl Merkley wrote:

>I am running the Darwin 2.2.2 version downloaded from www.cmake.org.
>
>I have a simple CMakeLists.txt where I want to combine C++ and FORTRAN.
>
>PROJECT(add_fortran FORTRAN)
>ADD_EXECUTABLE(add_fortran main.cpp testf1.f)
>
>When I execute cmake I get the following errors.
>
>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
>-- Check for working Fortran compiler: g77
>CMake Error: Unknown extension ".f" for file  
>"/Users/kgmerk/projects/cmake_fortran/build/CMakeTmp/ testFortranCompiler.f".  TRY_COMPILE only works for enabled languages.
>Currently enabled languages are: FORTRAN
>See PROJECT command for help enabling other languages.
>-- Check for working Fortran compiler: g77 -- broken
>The Fortran compiler "g77" is not able to compile a simple test program.
>It fails with the following output:
>
>
>CMake will not be able to correctly generate this project.
>CMake Error: CMAKE_FORTRAN_COMPILER not set, after EnableLanguage
>-- Configuring done
>
>I defined the the two missing variables in my CMakeCache.txt file and I  
>still end up with .f being an unknown extension.
>
>Any ideas?
>
>     Thanks,
>           Karl
>
>_______________________________________________
>CMake mailing list
>CMake at cmake.org
>http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list