[CMake] CMake 2.6 + Intel Visual Fortran 10 with "/MD" flag?

Maik Beckmann beckmann.maik at googlemail.com
Fri May 30 12:00:42 EDT 2008


Am Freitag 30 Mai 2008 17:41:21 schrieb Kelly (KT) Thompson:
> Hi,
>
> I am having trouble writing CMakeLists.txt for a Fortran (Intel Visual
> Fortran 10) project that needs to use the link flags "/libs:dll
> /threads" (alternate "/MD").  I am generating a "Visual Studio 8 2005"
> project.  I have reduced the problem to a "hello world" F90 code:
>
> program main
>   print *, "hello"
> end program main
>
> My CMakeLists is here:
>
> cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
> project( hello )
> enable_language( Fortran )
> set( CMAKE_Fortran_FLAGS_DEBUG "/libs:dll /threads /dbglibs" )
> add_executable( main main.f90 )
> set_target_properties( main PROPERTIES LINKER_LANGUAGE Fortran )
>
> In MSVC, the F90 compile line turns into
>
> ifort /nologo /fpp /DCMAKE_INTDIR=\"Debug\" /module:".\Debug"
> /object:"main.dir\Debug\\" /libs:static /threads /c  /W1 /libs:dll
> /threads /dbglibs /Qvc8 /Qlocation,link,"C:\Program Files\Microsoft
> Visual Studio 8\VC\bin" "C:\...\main.f90"
>
> It looks like my custom flags "/libs:dll /threads /dbglibs" are in the
> right place, but there are conflicting flags "/libs:static" also.
>
> Question: How do I remove the "libs:static" flag from the compile line?

The flags pushed in by cmake are are in 
 - Modules/Platform/Windows-ifort.cmake
If you take a look you'll see their is no libs:static (ifort's ways to 
say /MT) at all.  Did you set FFLAGS which contains this flag?

-- Maik


More information about the CMake mailing list