[CMake] Configure Mac OS X for 32-bit

Bill Hoffman bill.hoffman at kitware.com
Mon May 3 21:33:45 EDT 2010


On 5/3/2010 9:10 PM, Tron Thomas wrote:
> The concern with building a universal binary for debug is only the time
> involved in the build. It doesn't matter as much on a fast machine.
> However, I full rebuild on a slower machine can have some impact on
> productivity. It would be better not to build code that is never going
> to get used.

I think you are using CMake slightly different than is expected.  It was 
expected that by default a project would only build one architecture. 
If you want to build a project for more than one arch then you set an 
environment variable before running cmake, or set a value in the cache.

For example when I build CMake for release the driver script does this:

set(ENV{CMAKE_OSX_ARCHITECTURES} "ppc;i386")

This should be up to the person building the software, and not hard 
coded into the projects CMakeLists.txt files.  That way in day to day 
development you don't have to build twice.  However, when you are ready 
to deploy then you build with different options to get the "fat" binary.

>
> CMake already has something that might try to implement the ability to
> configure different architectures for debug or release builds.
>
> What is the difference between CMAKE_OSX_ARCHITECTURES and just
> OSX_ARCHITECTURES, both of which are mentioned in the CMake help
> documentation?
CMAKE_OSX_ARCHITECTURES is a cache variable and OSX_ARCHITECTURES is a 
target property.

-Bill


More information about the CMake mailing list