[CMake] Mixed Fortran and C sources with Visual Studio 10

Brian Wainscott brian at lstc.com
Mon Oct 21 18:50:11 EDT 2013


I'm trying to convert a large(ish) project to cmake.  Everything works fine in
Linux, but I'm having problems on Windows.

Specifically, we have both C and Fortran sources mixed together in a single
directory.  Cmake is producing an vcxproj file and none of the Fortran code gets
compiled.

I've been informed that I probably need two project files, one for C and one for
Fortran (vfproj).  OK -- so why does cmake not then produce two project files? 
Am I missing a flag or setting somewhere?

As a concrete test, I tried this for a CMakeLists.txt file:

enable_language(Fortran)
enable_language(C)
add_executable(tst tst.F cfunc.c)

with a trivial Fortran main and C subroutine.  It builds fine in Linux, but not
on Windows.

Everything works so well in Linux that I have a hard time believing that anything
complex should be required for Windows -- I must be missing something simple but
can't find any information on what it might be.

Any suggestions on how to get this to work?

I'm using cmake 2.8.11.2 with VS 10 and my Fortran compiler is Intel Composer XE
2013.

Thanks,

Brian


More information about the CMake mailing list