[CMake] Fortran_FORMAT

Nils Gladitz nilsgladitz at gmail.com
Thu Mar 13 14:15:18 EDT 2014


On 13.03.2014 17:40, Jack Stalnaker wrote:
> Can someone provide an example of Fortran_FORMAT in use? I cannot find 
> anything other than a definition of the property online. Does one use
>

I am not much of a Fortran person but:

    cmake_minimum_required(VERSION 2.8.12)

    project(Foo Fortran)

    add_executable(free free.f)
    set_target_properties(free PROPERTIES Fortran_FORMAT "FREE")

    add_executable(fixed fixed.f)
    set_target_properties(fixed PROPERTIES Fortran_FORMAT "FIXED")

Produces the following compile command on my system (with the gnu 
Fortran compiler):

    /usr/bin/f95    -ffixed-form -c
    /home/ngladitz/src/test/fortran/fixed.f -o
    CMakeFiles/fixed.dir/fixed.f.o
    /usr/bin/f95    -ffree-form -c
    /home/ngladitz/src/test/fortran/free.f -o CMakeFiles/free.dir/free.f.o


The respective -ffixed-form -ffree-form options are compiler specific.
Which compiler are you using?

Nils
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140313/a35abea9/attachment.html>


More information about the CMake mailing list