[CMake] How to generate xcodeproj file correctly for Xcode?

Brad King brad.king at kitware.com
Mon Dec 14 11:13:00 EST 2009


DONG Li wrote:
> I am trying move my project from Linux to Mac. I have modified some
> cmake files to successfully generate Makefile, but I'd like generate
> xcodeproj file for use in Xcode. A few errors appeared, as following:

AFAIK the Xcode generator is totally untested with the Intel Fortran
plugin for Xcode, and is not currently supported by CMake.

> 1.  Fortran compiler
> In the command line output of running "cmake -G Xcode ../<project src>",
> I can see that the Fortran compiler is 32-bit
> 
> -- Checking whether /opt/intel/Compiler/11.1/076/bin/ia32/ifort supports
> Fortran 90
> -- Checking whether /opt/intel/Compiler/11.1/076/bin/ia32/ifort supports
> Fortran 90 -- yes
> 
> but when I built project in Xcode, I found the actual Fortran compiler
> is "/Developer/usr/local/bin/ifort-11.1-base/bin/intel64/ifort". It is
> so strange. Why is that?

Currently the Xcode generator does not correctly detect the compiler
that Xcode uses behind the scenes.  I've been working on this problem
for the C and C++ compilers but it is non-trivial to fix and has not
really bitten anyone yet.

> 2.  Fortran flags
> I have added "-r8" to CMAKE_Fortran_FLAGS. It took effect when
> generating Makefile, but not when generating xcodeproj.
>
> 3. include path and module path are not correct.

As I said above, CMake has no support for Fortran with Xcode right now.
I think it happens to work in some simple cases.  You can submit a
feature request, but I don't know when we'll get to it.

-Brad


More information about the CMake mailing list