[CMake] C++ and FORTRAN

Allen Barnett allen at transpireinc.com
Wed May 28 10:32:30 EDT 2008


On Wed, 2008-05-28 at 15:56 +0200, Maik Beckmann wrote:
> Am Mittwoch 28 Mai 2008 15:25:06 schrieb Bill Hoffman:
> > Yup, sorry, won't work.  Each target (library, exe) must be all fortran.
> >   The IDE does not support mixed CXX and Fortran. So, you would have to
> > have:>
> > CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
> >
> > ENABLE_LANGUAGE( Fortran )
> >
> > ADD_LIBRARY(myfortran STATIC f.f90)
> > ADD_EXECUTABLE(
> >   cf
> >   c.cpp
> > )
> > target_link_libraries(cf myfortran)
> >
> 
> This will result in a solution which contains a Visual Fortran Static Library 
> project and a Visual C++ Executable project?

Thanks Bill, Arjen, Alin and Maik. This did the trick. I did have to add
all the Intel FORTRAN link libraries explicitly to the
target_link_libraries. Somehow these were magically found when the NMake
Makefile route is taken, but otherwise this works fine.

(I was quite happy with nmake, EMACS and a dos prompt :-)

Thanks,
Allen

-- 
Allen Barnett
Transpire, Inc.
e-mail: allen at transpireinc.com




More information about the CMake mailing list