[CMake] recommended way to test for msvc/cl ?

Alexander Neundorf a.neundorf-work at gmx.net
Mon Jan 30 14:09:43 EST 2006


Hi, 
 
> Von: David Cole <david.cole at kitware.com> 
>  
> Wouldn't it be preferable to remain compile independent as much as  
> possible and avoid CMake blocks that are compiler specific? 
>  
> Perhaps a TRY_COMPILE would be more appropriate than the "compiler  
> matches regex" test... 
>  
> You didn't actually say when starting this thread why you wanted to  
> detect the cl compiler. Is it so you can set some compiler specific  
> flags? Or do you have source that is known only to compile with cl? Is  
> CMake missing a feature that requires you to know what compiler is 
> being used? 
 
Well, there are files which only have to be compiled when using msvc: 
http://websvn.kde.org/trunk/KDE/kdelibs/win/ . 
 
And then there are different flags which have to be set, e.g. for 
enabling/disabling exceptions. 
 
Bye 
Alex 
 

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner


More information about the CMake mailing list