[CMake] [MinGW64] cmake can't validate cxx and fortran compilers.

Sisyphus sisyphus1 at optusnet.com.au
Thu Jul 8 06:03:05 EDT 2010


Please consider this as a "report" rather than a "complaint" - and I'm not 
even sure that the problem lies with cmake. Faik it may be a plplot issue.

I'm using the 64-bit MinGW64 (gcc) cross-compiler to build plplot-5.9.6 on 
Windows Vista64 and noticed that CMAKE_Fortran_COMPILER and 
CMAKE_CXX_COMPILER options are not working as I expect.

With this particular compiler, the gcc, ar, g++ and gfortran executables are 
all prefixed with ' x86_64-w64-mingw32-'. There's no problem with

and with

But neither


enables the compiler in question to be found.

Attached is the output of running

cmake -G "MinGW 
Makefiles" -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=install -DCMAKE_AR:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-ar.exe 
-DBUILD_TEST=ON -DCMAKE_Fortran_COMPILER:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-gfortran.exe 

I think the key bit is "The Fortran compiler identification is unknown". Why 
would that be the case for x86_64-w64-mingw32-g++.exe and 
x86_64-w64-mingw32-gfortran.exe, but not x86_64-w64-mingw32-gcc.exe and 
x86_64-w64-mingw32-ar.exe ?

(I've omitted specifying the CXX argument above - but when I do specify it, 
output is essentially the same as for Fortran.)

I should add that this is not actually a "show-stopper". If I create copies 
of the fortran and g++ executables named 'gfortran.exe' and 'g++.exe', then 
everything works fine - but that's a somewhat hackish solution.

Btw, my gcc compiler version is currently 4.6.0, and I got the same 
behaviour with 4.4.4.

If there's something else I can do/try to help solve this, I'm quite happy 
to oblige.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cmake.txt
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100708/70b57de3/attachment.txt>

More information about the CMake mailing list