[CMake] Choice of compilers

Bill Hoffman bill.hoffman at kitware.com
Thu Jun 17 19:42:43 EDT 2010


On 6/17/2010 11:07 AM, Alok Govil wrote:
> Hi Alan,
>
>  > > Just like CMake is able to distinguish different versions of Visual
> Studio,
>  > > would it distinguish MinGW-32 with MinGW-64 also (which means
> either both
>  > > would be in path simultaneously, or neither would be, and cmake
> picks the
>  > > right one based on the generator specifed)? Let me know if so, and
> I'll be
>  > > happy to test this.
>  >
>  > I had never heard of those MinGW variants until you mentioned them,
> and it
>  > appears CMake is not specifically aware of them either. I presume that's
>  > why you had to rename to gcc.exe (something CMake specifically
> recognizes)
>  > to get them to work. But that is a brute-force way to get CMake to
>  > recognize a compiler with a different name. I would forget the renaming,
>  > and instead use CMAKE_<LANG>_COMPILER (e.g., CMAKE_C_COMPILER,
>  > CMAKE_CXX_COMPILER, etc.) to allow you to choose which compiler (the
> 32-bit
>  > variant or 64-bit variant) you want to use. See the CMake
> documentation for
>  > how to use CMAKE_<LANG>_COMPILER.
>
> Just FYI:
>
> Reading the change-log for RC1 and RC2 (see below), I assuming that
> CMake has gained ability to build on MinGW-W64 (see below). As I now
> know, CMake 2.8 builds on MinGW-W64 already.
>
> Changes in CMake 2.8.2-rc1 (since 2.8.1):
> - Build on Tru64 (#10542)
> - Build on mingw-w64
> ...
>
> I'll look into your suggestion again. In general, the prefixes and
> renaming issue with MinGW is a MinGW issue I would think. And this needs
> to be done not just for g++.exe, but some 15-20 .exe files in the bin
> folder. In fact to keep things compatible with different tools, they
> already put one file under several names!
>
This has some information about the build on mingw64 and the choice of make:

http://public.kitware.com/Bug/view.php?id=10690

-Bill


More information about the CMake mailing list