[CMake] How to prefix fortran source files with special compile flag?

Kelly (KT) Thompson kt at transpireinc.com
Mon Nov 2 21:02:12 EST 2009


That works for me.  Thanks Bill!

On Fri, Oct 30, 2009 at 6:08 PM, Bill Hoffman <bill.hoffman at kitware.com>wrote:

> Kelly (KT) Thompson wrote:
>
>> Hi,
>>
>> I am trying to use Intel ifort on Linux to compile source code that uses
>> the extension .F95.  By default, ifort will not compile files with this
>> extension.  To allow the compilation, the name of the source file must be
>> preceded by -Tf (treat the next option as fortran source). While I know how
>> to modify the Fortran flags, I don't know how to add the '-Tf' flag that is
>> directly in front of the source file name (and after the -c).  Can anyone
>> point me in the right direction?
>>
>>
> You could try this:
>
> Edit
> /Modules/Platform/Linux-Intel-Fortran.cmake
>
> And add this:
>
>  SET(CMAKE_Fortran_COMPILE_OBJECT
>    "<CMAKE_Fortran_COMPILER> -o <OBJECT> <DEFINES> <FLAGS> -c -Tf
> <SOURCE>")
>
> I think that will work.
>
>
> -Bill
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091102/35496549/attachment.htm>


More information about the CMake mailing list