[cmake-developers] Identifying GNU C Compiler
Alexander Neundorf
neundorf at kde.org
Mon Jan 16 15:13:20 EST 2012
On Monday 16 January 2012, Rolf Eike Beer wrote:
> According to documentation you can use the following variable to check if
> your compiler is the GNU one:
>
> CMAKE_COMPILER_IS_GNU<LANG>
>
> Well, this is actually only true for C++ as in CXX. If your language is C,
> then LANG is not C, but CC. If your language is Fortran, LANG is neither
> FORTRAN nor Fortran, but G77.
>
> Confusing, isn't it?
I assume you know that the better way to check is to compare
CMAKE_<lang>_COMPILER_ID, with <lang> being "C", "CXX" and "Fortran" ?
Alex
More information about the cmake-developers
mailing list