Re: [CMake] linking main Fortran and C++

2010-10-21 Thread Jed Brown
On Thu, Oct 21, 2010 at 16:52, M. Scot Breitenfeld brtn...@uiuc.edu wrote:  It was part of a section detecting if mpi is present, if it is then it uses the mpi** compiler wrappers instead: IF ( MPI_FOUND )  SET (CMAKE_Fortran_COMPILER  mpif90)  SET (CMAKE_CC_COMPILER  mpicc) This is a typo,

Re: [CMake] linking main Fortran and C++

2010-10-20 Thread kent williams
I know you're simplifying to provide an example, but I hope you don't normally set CMAKE_CC_COMPILER, CMAKE_Fortran_COMPILER and CMAKE_CXX_COMPILER in your CMakeLists.txt. That's precisely the sort of thing that CMake is meant to find for you. It will find the compilers needed to compile your

[CMake] linking main Fortran and C++

2010-10-18 Thread Michael Scot Breitenfeld
My main program is in Fortran and I have couple of files that are in C++. When I try to make the library, CMake uses CXX linking (archiving) to make the library. Which I guess is ok, but then when it links the main program it thinks that it is a CXX executable and

Re: [CMake] linking main Fortran and C++

2010-10-18 Thread Michael Hertling
On 10/19/2010 03:43 AM, Michael Scot Breitenfeld wrote: My main program is in Fortran and I have couple of files that are in C++. When I try to make the library, CMake uses CXX linking (archiving) to make the library. Which I guess is ok, but then when it links the

Re: [CMake] linking main Fortran and C++

2010-10-18 Thread Michael Scot Breitenfeld
Thanks, this works now: PROJECT( Test) SET(PACKAGE_NAME TEST) CMAKE_MINIMUM_REQUIRED (VERSION 2.6) SET (CMAKE_Fortran_COMPILER gfortran) SET (CMAKE_CC_COMPILER gcc) SET (CMAKE_CXX_COMPILER g++) # libraries are all shared by default option(BUILD_SHARED_LIBS Build shared libraries OFF)