[CMake] Can't set CMAKE_Fortran_FLAGS ?

Bill Hoffman bill.hoffman at kitware.com
Thu May 1 13:08:57 EDT 2008


Convey Christian J NPRI wrote:
> I'm using cmake version 2.7-20080501, and I'm having trouble setting CMAKE_Fortran_FLAGS.  Any suggestions about what I'm doing wrong?
> 
> Here's my CMakeLists.txt file:
> 
> SET(CMAKE_Fortran_COMPILER "/usr/bin/f77")
> SET(CMAKE_Fortran_FLAGS "-fno-backslash")
> PROJECT(CASS-4.1 Fortran)
> ADD_SUBDIRECTORY(bistatic)
> ADD_SUBDIRECTORY(latex)
> 
> 
> When I run cmake, and then use ccmake to inspect the cache file, I find that:
> - I did successfully force the compiler to be f77 rahter than f95.
> - The variable CMAKE_Fortran_FLAGS is still blank.
> 
> I get this behavior even after removing any extant CMakeCache.txt files and CMakeFiles directories.
> 
> Thanks for any suggestions.
> 
> 
setenv FC /usr/bin/f77
setenv FFLAGS "-fno-backslash"
cmake

Setting the compiler before the project command is not a good idea.


-Bill



More information about the CMake mailing list