On 07/27/2012 12:50 PM, Ho Cheung wrote:
> If this is the case, how would one go about enabling compiler options 
> specifically for Xcode?
> 
> My project currently supports gcc and msvc which I check with 
> CMAKE_COMPILER_IS_GNUCC or MSVC variables respectively.
> 
> Since Xcode uses clang but CMAKE_C_COMPILER is set to gcc, the gcc compiler 
> flags are being passed to clang.

One workaround is to use the CheckCCompilerFlag module:

 http://www.cmake.org/cmake/help/v2.8.8/cmake.html#module:CheckCCompilerFlag
 
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CheckCCompilerFlag.cmake;hb=v2.8.8
 
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CheckCXXCompilerFlag.cmake;hb=v2.8.8

to test for the flag in question.

As I said in my last response this is a bug in the Xcode
generator but so far it hasn't been painful enough to motivate
anyone to fix it.

-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to