[CMake] Incremental linking and Intel fortan

Alexander Ivanov alexander.nik.ivanov at gmail.com
Fri Aug 31 14:47:22 EDT 2012


Hello all!

I am trying to adopt cmake for fortran based project. This is my first
CMakeLists.txt for
fortran.

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(CMAKE_EXE_LINKER_FLAGS "/INCREMENTAL:NO"
    CACHE STRING "EXE_LINKER_FLAGS" FORCE)
PROJECT(TestF90 Fortran)
ADD_EXECUTABLE (TestF90_EXE main.f90)

main.f90 looks like the following

program TestF90
    implicit none
    integer :: I = 1
    I = I / 0
end program TestF90

Actually I would like to use /traceback option of the Intel compiler and it
requires to turn off
incremental linking for the traceback. The above (I mean setting of
CMAKE_EXE_LINKER_FLAGS)
works well for the similar C project, but Intel fortran ignores the option.
I noticed that TestF90.vfproj
file contains different settings depending on what I put in
CMAKE_EXE_LINKER_FLAGS:
LinkIncremental="1" - for "/INCREMENTAL:NO"
LinkIncremental="2" - for "/INCREMENTAL:YES".

Anyway linker property list shows "Default". After some experiments I found
that if I change
TestF90.vfproj manually and put LinkIncremental="linkIncrementalNo" then
Intel fortran accepts
the option.

So how can I achieve the desirable behaviour?

I use visual studio 2010, fortran 2011.9 and cmake 2.8.9.

Thanks,
Alexander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120831/f2a9ed9a/attachment.htm>


More information about the CMake mailing list