[CMake] Xcode Generator

Axel Roebel Axel.Roebel at ircam.fr
Thu Dec 14 08:40:24 EST 2006


On Wednesday 13 December 2006 19:57, Bill Hoffman wrote:
> Sean McBride wrote:
> > On 2006-12-13 18:27, Axel Roebel said:
> >> Everything works fine for unix makefiles (on Linux and Mac OS X)
> >>
> >> Now, we tried the Xcode generator and we am having
> >> some minor problems with it.
> >>
> >> 1)
> >> It appears that the default build style in the Xcode project is
> >> set to debug while for my makefile build system it always is set to
> >> release. So we wonder why these two are different.
> >>
> >> Note, that we set CMAKE_BUILD_TYPE to release.
> >
> > This once surprised me too.  Bill told me:
> >
> > "CMAKE_BUILD_TYPE is ignored by Xcode and VS IDE projects. You have to
> > change the MAKECOMMAND to do the right build.  It is a command line
> > option to xcodebuild that has to be changed."
>
> Since VS IDE and Xcode support building different builds from the GUI,
> Debug, Release, etc,
> CMake generates projects that do the same.  There is not one build type
> like in the Makefile projects.
> The user when running the GUI, has to pick which one to build.  With MS
> IDE, there is no way for
> us to change the default build type in one of the files we can
> generate.   There maybe a way in Xcode,
> but I have not found it (or really looked for it).   So, you have to
> pick the build type from the GUI,
> or set the build type from the command line with xcodebuild.

I am not using Xcode myself but a very brief look into the
cmake source reveals that the variable

CMAKE_CONFIGURATION_TYPES

is used instead of CMAKE_BUILD_TYPE. Now the default value for 
CMAKE_CONFIGURATION_TYPES is  "Debug;Release;MinSizeRel;RelWithDebInfo".

Simply setting CMAKE_CONFIGURATION_TYPES to

 "Release;Debug;MinSizeRel;RelWithDebInfo"

was sufficient to convince Xcode to build 
with release instead of Debug mode by default.

I would suggest to change this order in cmake
because having debug as default in a software 
distribution seems not so appropriate given that you
cannot assume that all people that may download 
and compile  your software with Xcode are
really knowing what they are doing.

As suggested by Gonzalo the same change of order may
be a simple solution for other IDE's as well.




> -Bill
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Axel Roebel    
IRCAM Analysis/Synthesis Team
Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540


More information about the CMake mailing list