[CMake] CMAKE_COMPILER_IS_GNUC vs. CMAKE_COMPILER_IS_GNUCC

Michael Wild themiwi at gmail.com
Mon Jul 5 04:23:46 EDT 2010


On 5. Jul, 2010, at 7:46 , Todd Gamblin wrote:

> The documentation here:
> 
> 	http://www.cmake.org/cmake/help/cmake2.6docs.html#variable:CMAKE_COMPILER_IS_GNULANG
> 
> is in conflict with the documentation here:
> 
> 	http://www.cmake.org/Wiki/CMake_Useful_Variables
> 
> And this thread (though it's from 2008) seems to imply that the second link above is right, even though the first is more current:
> 
> 	http://www.mail-archive.com/cmake@cmake.org/msg16863.html
> 
> 
> I'm using CMake 2.8.2, and I'm noticing that CMAKE_COMPILER_IS_GNUC is empty, which conflicts with the latest documentation on the wiki.  This makes it hard to do things like this:
> 
>> 	for (lang C CXX Fortran)
>> 		if (CMAKE_COMPILER_IS_GNU${lang})
>> 			...
>> 		endif()
>> 	endfor()
> 
> Looking through the CMake source, it doesn't look like CMAKE_COMPILER_IS_GNUFortran is used anywhere.  I tested it, and it looks like it's empty too.  Would it be possible to add CMAKE_COMPILER_IS_GNUC and CMAKE_COMPILER_IS_GNUFortran so that they actually work?  I think this would be more consistent than the current setup.
> 
> These issues are coming up in the platform files I'm making for BlueGeneP.  I think writing things like this would be easier if this were more consistent.
> 
> -Todd

The variables are called CMAKE_COMPILER_IS_GNUC, CMAKE_COMPILER_IS_GNUCXX and CMAKE_COMPILER_IS_GNUG77 (the latter is admittedly weird)

Michael


More information about the CMake mailing list