If you need to specify compilers that are not picked up by default, use environment variables to do so.<div><br></div><div>See this FAQ entry:</div><div><a href="http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F">http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F</a></div>
<div><br></div><div>Prefer the first method -- does it work if you set FC?</div><div><br></div><div>Also, make sure you use full paths to the compilers. If not using full paths, then the executables must be in the PATH when cmake runs.</div>
<div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br><br><div class="gmail_quote">On Thu, Jul 8, 2010 at 6:03 AM, Sisyphus <span dir="ltr">&lt;<a href="mailto:sisyphus1@optusnet.com.au">sisyphus1@optusnet.com.au</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
Please consider this as a &quot;report&quot; rather than a &quot;complaint&quot; - and I&#39;m not even sure that the problem lies with cmake. Faik it may be a plplot issue.<br>
<br>
I&#39;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.<br>
<br>
With this particular compiler, the gcc, ar, g++ and gfortran executables are all prefixed with &#39; x86_64-w64-mingw32-&#39;. There&#39;s no problem with<br>
<br>
-DCMAKE_C_COMPILER:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-gcc.exe<br>
and with<br>
-DCMAKE_AR:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-ar.exe<br>
<br>
But neither<br>
<br>
-DCMAKE_CXX_COMPILER:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-g++.exe<br>
nor<br>
-DCMAKE_Fortran_COMPILER:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-gfortran.exe<br>
<br>
enables the compiler in question to be found.<br>
<br>
Attached is the output of running<br>
<br>
cmake -G &quot;MinGW Makefiles&quot; -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=install -DCMAKE_AR:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-ar.exe -DCMAKE_C_COMPILER:FILEPATH=x86_64-w64-mingw32-gcc.exe<br>
-DBUILD_TEST=ON -DCMAKE_Fortran_COMPILER:FILEPATH=C:/_64/mingw64/bin/x86_64-w64-mingw32-gfortran.exe ..<br>
<br>
I think the key bit is &quot;The Fortran compiler identification is unknown&quot;. 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 ?<br>

<br>
(I&#39;ve omitted specifying the CXX argument above - but when I do specify it, output is essentially the same as for Fortran.)<br>
<br>
I should add that this is not actually a &quot;show-stopper&quot;. If I create copies of the fortran and g++ executables named &#39;gfortran.exe&#39; and &#39;g++.exe&#39;, then everything works fine - but that&#39;s a somewhat hackish solution.<br>

<br>
Btw, my gcc compiler version is currently 4.6.0, and I got the same behaviour with 4.4.4.<br>
<br>
If there&#39;s something else I can do/try to help solve this, I&#39;m quite happy to oblige.<br>
<br>
Cheers,<br>
Rob<br>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>