[CMake] Suggestion for CMake platform/compiler detection
Alexander Neundorf
a.neundorf-work at gmx.net
Tue Nov 14 11:02:41 EST 2006
Hi Tanguy,
Von: Tanguy Krotoff <tanguy.krotoff at wengo.fr>
so did OpenWengo now officially switch to CMake ?
> Hi
>
> Cmake supports several boolean for platform/compiler detection:
> UNIX
> APPLE
> WIN32
> CYGWIN
> MINGW
> BORLAND
>
> I think this approach is too simple and not very easy for the developer.
>
> What about code that I want to compile under Windows using Borland,
> Intel, MinGW and MSVC?
> What about code compiled under Cygwin? IF (UNIX) is true or not?
> What about Intel compiler under UNIX?
>
> A good and simple approach is to totally separate platform OS detection
> >from compiler detection.
>
> I see something like this:
>
> Operating systems:
> - OS_WINDOWS
> - OS_WIN32
...
> Compilers:
> - CC_MSVC (Microsoft Visual C++)
> - CC_MSVC6 (Visual C++ 6)
...
>
> Qt as the same approach and I think Qt is a good example of a massively
> multiplatform tool.
>
> See qglobal.h at:
> http://doc.trolltech.com/3.3/qglobal-h.html
>
> It would be good for CMake to have the same separation between OS and
> compiler detection, what do you think?
CMake has some of that.
It has for OS:
UNIX
APPLE
WIN32
CYGWIN
MINGW
And for the compilers:
Not sure it has GCC, but at least it has CMAKE_COMPILER_IS_GNUCXX
BORLAND
MSVC
For the Intel Compiler in KDE we currently check using
if(CMAKE_C_COMPILER MATCHES "icc")
So there is room for improvement.
I think mainly some of the cmake files in Modules/ and Modules/Platforms/ would have to be extended. For compatibility reasons I'm not sure new prefixes like "OS_" and "CC_" would be a good idea.
You know already which sentence follows next... ;-)
Feel free to send a patch :-)
Bye
Alex
--
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!
More information about the CMake
mailing list