[CMake] CMAKE_COMPILER_IS_GNUC vs. CMAKE_COMPILER_IS_GNUCC

Todd Gamblin tgamblin at llnl.gov
Mon Jul 5 01:46:15 EDT 2010


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




More information about the CMake mailing list