[CMake] check_cxx_compiler_flag() doesn't work with cl.exe/rc.exe

Dizzy dizzy at roedu.net
Mon Aug 27 13:29:10 EDT 2007


Hello

I use check_cxx_compiler_flag(-ansi -pedantic) to try to use these flags where 
they are valid. However when using nmake makefiles generator cmake doesn't 
seem to detect that cl.exe doesn't need them (I noticed cl.exe doesn't error 
but warns on using those flags but this still means the compiler doesn't 
support them, not to mention it creates tons of redundant warnings about 
those flags).

Second issue is with rc.exe. When adding a .rc file to add_executable() it 
appears that cmake tries to use rc.exe for it passing all compiler arguments 
it used before. While cl.exe warns on unknown flags, rc.exe errors and as 
such I cannot build my project with nmake makefiles generator. Of course I 
could add an if(MSVC) but that would beat the purpose of 
check_cxx_compiler_flag() I believe. Is this a known issue or something I 
missed?

Thank you.

PS: I noticed people posting on the list useful scripts for cmake, is this a 
good way to do so? I have some scripts I would like to share with the others

-- 
Mihai RUSU					Email: dizzy at roedu.net
GPG : http://dizzy.roedu.net/dizzy-gpg.txt	WWW: http://dizzy.roedu.net
			"Linux is obsolete" -- AST


More information about the CMake mailing list