[CMake] Configure Mac OS X for 32-bit

Karl Merkley karl at elemtech.com
Mon May 3 11:59:36 EDT 2010


On May 3, 2010, at 9:24 AM, Bill Hoffman wrote:

> On 5/3/2010 11:11 AM, Tron Thomas wrote:
>> What is the purpose for the OSX_ARCHITECTURE and
>> OSX_ARCHITECTURES_<CONFIG> properties that already exist in CMAKE? It
>> seems like they might be properties that are already meant to address an
>> issue like this, only I can't figure out how they work.
>> 
> OSX_ARCHITECTURES is mostly meant to select which archs you want to build. It was designed with the idea that it would be selected by the end user and not in the CMakeLists.txt of the project.   CMake uses this to create its fat binaries (ppc/i386) on the mac.
> 
>> Also, I think previous versions of CMake did not have this problem, only
>> I'm not certain of that.
>> 
> We just verified, CMake 2.2.3 through to 2.8.1 all default to building 64 bit on 10.6.  The change was by Apple not CMake.
> 
> -Bill


I just read through this entire thread and I would like to expand it a little.   Regardless of platform, what is the right way to determine the right build architecture?  I run on a 32 bit Linux box but I use distcc which distributes the build to some 64 bit machines.    I always just edit the CMakeCache.txt manually and add the -m32 flag.    Some of my customers don't like that approach and would like to automate the decision for Mac, Linux and Windows.    So I need to determine is that platform that cmake runs on 32 bit or 64 bit and then set the correct flags for each platform.    

Any ideas?

   Karl




More information about the CMake mailing list