[CMake] fortran flags in a c++ linked executable

James C. Sutherland James.Sutherland at utah.edu
Tue Mar 31 11:28:16 EDT 2009


I am trying to compile a mixed f90/C++ program linked with g++.

The fortran compiler flags don't seem to be automatically passed  
through to the g++ linker.

For example, I want to do:
	set( CMAKE_Fortran_FLAGS "-fconvert=big-endian" )

When I do this for a fortran program (linked with gfortran) it  
respects this flag and IO is done in big-endian.

When I do this for a C++ program that calls f90 subroutines and linked  
via g++, the endian switch is not made.  The program compiles and runs  
fine in native endian format, but not when I try to force big-endian.



More information about the CMake mailing list