[CMake] Configure Mac OS X for 32-bit

Mike Jackson mike.jackson at bluequartz.net
Sun May 2 15:43:22 EDT 2010


I think part of the problem you are seeing is that OS X 10.6 defaults
to a 64 bit build where as OS X 10.5 defaults to a 32 bit build. So in
order for you to build a 32 bit binary on OS X 10.6 you need to
specifically set "CMAKE_OSX_ARCHITECTURES" to i386 when you want to
build a 32 bit i386 executable on OS X 10.6.
  You can generate a 32 bit PPC executable by setting
CMAKE_OSX_ARCHITECTURES=ppc. The set the CMAKE_BUILD_TYPE to "Debug"
and that should get you a 32 bit PPC executable that has Debugging
symbols.
_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net


On Sun, May 2, 2010 at 11:41 AM, Tron Thomas <tron.thomas at verizon.net> wrote:
> Before when I was using an earlier version of CMake, it would configure the
> project to build a 32-bit version of all the project target's regardless of
> which version of Mac OS X I was using.  It would also build just the
> platform specific version of the targets for a debug build.
>
> Now that I have upgraded to CMake version 2.8.1, CMake wants to configure
> the project's targets to build for 64-bit on Mac OS X 10.6.
>
> The only way I've found so far to make Mac OS X 10.6 build 32-bit, is to
> modify the CMAKE_OSX_ARCHITECTURES to include i386.  However, if I set
> CMAKE_OSX_ARCHITECTURES to only i386, then it will build create an Intel
> version of all targets when I build on a PowerPC system.  That means I won't
> be able to run and test the targets on that platform.
>
> I'm trying to get things back to where they were before I upgraded to CMake
> 2.8.1.  I want it to configure Xcode to build 32-bit targets, with
> architecture specific version for debug builds.
>
> How can someone accomplish this?
>
> On 05/02/2010 01:58 AM, Michael Wild wrote:
>
> Well, setting CMAKE_OSX_ARCHITECTURES to i386 AND ppc is going to get you a
> universal build, both of the architectures being 32-bit. So, what is it
> exactly that you want?
>
> Michael Wild
>
> On Sun, May 2, 2010 at 8:15 AM, Tron Thomas <tron.thomas at verizon.net> wrote:
>>
>> It looks like:
>> set (CMAKE_OSX_ARCHITECTURES "i386 ppc")
>>
>> will build a universal binary for a debug build on any platform.  How can
>> someone configure things so that Xcode will build a platform specific debug
>> version that is 32-bit?
>>
>>
>> On 05/01/2010 04:55 PM, Mike Jackson wrote:
>>>
>>> You need to set the CMAKE_OSX_ARCHITECTURES to i386. The default build
>>> on snow leopard is 64bit where as on leopard it is 32 bit.
>>>
>>> -----
>>> Mike Jackson                      www.bluequartz.net
>>> Principal Software Engineer       mike.jackson at bluequartz.net
>>> BlueQuartz Software               Dayton, Ohio
>>>
>>>
>>> On May 1, 2010, at 15:33, Tron Thomas<tron.thomas at verizon.net>  wrote:
>>>
>>>
>>>>
>>>> I am writing a cross platform application using CMake that builds on
>>>> Mac OS X.  I just upgraded to CMake 2.8-1.  When I configure and
>>>> build my project on my Power Mac G5 system running Mac OS X 10.5.8,
>>>> the project builds just fine.
>>>>
>>>> When I try to configure the project on my MacBook Pro running Mac OS
>>>> X 10.6.3, I get link errors because the project has been configured
>>>> to build 64-bit applications and some of the needed libraries and
>>>> frameworks the project links with are only 32-bit.
>>>>
>>>> How can I configure my CMake scripts so that the project will build
>>>> a 32-bit application on my MacBook Pro?
>>>>
>>>> _______________________________________________
>>>> 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://www.cmake.org/mailman/listinfo/cmake
>>>>
>>>
>>>
>>
>> _______________________________________________
>> 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://www.cmake.org/mailman/listinfo/cmake
>
>
>


More information about the CMake mailing list