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

James C. Sutherland James.Sutherland at utah.edu
Tue Mar 31 19:33:04 EDT 2009


Alin,

Thank you for your patience.  I now have this set via
	set( CMAKE_EXE_LINKER_FLAGS "-mbig-endian" )

However, this does not seem to affect the reading of the big-endian  
binary file (which is in read in fortran).  Perhaps I am still not  
setting it properly?

James


On Mar 31, 2009, at 1:30 PM, Alin M Elena wrote:

> man g++
> add_definition is a preprocessor directive not linking flag
>
> Alin
> -- 
> ______________________________________________________________________
> "If the Universities will not study useless subjects, who will?"
> G. F. FitzGerald, Nature, 45/46, 392 (1892)
> ______________________________________________________________________
> Mr Alin M ELENA
> Irish Centre for High-End Computing -- www.ichec.ie
> The Design Tower, Trinity Technology & Enterprise Campus
> Grand Canal Quay, Dublin 2, Ireland
> Tel: +353 (0) 1 5241608 ext 29
> Fax: +353 (0) 1 7645845
> http://alin.elenaworld.net
> alin.elena at ichec.ie
> alinm.elena at gmail.com
> ______________________________________________________________________
> On Tuesday 31 March 2009 17:27:39 you wrote:
> > > Should not the flag be passed to the linker? So in this case the
> > > linker flags are read from the c++ compiler flags?
> >
> > I tried adding
> > add_definitions( ${CMAKE_Fortran_FLAGS} )
> > But the g++ linker complained about an unrecognized option (the -
> > fconvert=big-endian option).
> >
> > When linking, I pull in the gfortran library,
> > target_link_libraries( readx gfortran )
> >
> > When creating the fortran object files the appropriate flags are
> > passed, but the g++ compiler has no notion of endian-ness...
> >
> > Any other ideas?
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090331/6d1570f9/attachment-0001.htm>


More information about the CMake mailing list