[CMake] Interference between MSVC and g95

Arjen Markus arjen.markus at wldelft.nl
Wed May 14 02:18:51 EDT 2008


Hello,

while testing the PLplot configuration and build system using CMake 2.6
I stumbled upon a strange interference between MS Visual C/C++ and g95.

Here is a description of my platform:
- Windows XP
- MS Visual C/C++ 6.0
- g95, installed under MinGW

The following CMakeLists.txt file illustrates the problem:

# Testing combination MSVC and g95
#

project(g95_msvc)

set(PACKAGE g95_msvc)

include(CMakeDetermineFortranCompiler)
enable_language(Fortran)


set(g95_msvc_LIB_SRCS
simple.c
)

add_library(g95_msvc ${g95_msvc_LIB_SRCS})


If I leave out the two lines regarding Fortran, then a library
"g95_msvc.lib" will be built. If I include them a library "libg95_msvc.a"
will be built instead.

This would not be a big problem, I suppose, but the interference
goes beyond that: if I build a DLL, then I get complaints from the
linker about options like L\lib (in the PLplot project). g95 bails
out on such options as "STACK:1000000" that suddenly appear.

It means that a combination of MSVC and g95 in one project is
impossible. (It all works by the way with CVF as the Fortran
compiler, but I must remove g95 from the path then).

Note:
In the PLplot project, we mostly build separate DLLs/so's, so that
a combination of MSVC and g95 should be possible. In any case, in
a project that builds standalone executables in C and Fortran, any
incompatibility between these compilers would be unimportant, but
now this appears impossible.

Does anyone know how to solve this problem?

Regards,

Arjen



More information about the CMake mailing list