[cmake-developers] CMake, Xcode 4.4, and Mountain Lion
Brad King
brad.king at kitware.com
Fri Jul 27 13:12:38 EDT 2012
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
More information about the cmake-developers
mailing list