[CMake] Building Mac OSX .apps for Sys 10.6 and 10.8 with Cmake using 10.7.5 on the command line

Ed sbfreddie at comcast.net
Fri Feb 8 13:53:16 EST 2013


Sean:
Thanks for the suggestions.

On Feb 8, 2013, at 9:39 AM, Sean McBride wrote:

> On Fri, 8 Feb 2013 09:22:12 -0800, Ed said:
> 
>> Here is what I tried:
>> cmake -DCMAKE_OSX_64=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 -
>> DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ ..
> 
> I've never heard of "CMAKE_OSX_64" and google has only 7 results…

"CMAKE_OSX_64" is just a variable in the cmakelists.txt file which is converted to ARCH=X86_64.
Does this variable need to be set to CMAKE_OSX_ARCHITECTURES=X86_64 instead of ARCH=X86_64?

> 
>> It built fine and runs on 10.7.5 but does not run on 10.6.  10.6 barfs
>> with usual message saying this app was not built for this architecture.
> 
> If the error message speaks of architecture, then you've probably built as 64 bit-only or 32 bit-only.  Are you trying to run on a machine with 32 bit CPU?  In any case, try setting CMAKE_OSX_ARCHITECTURES to "i386;X86_64" to generate a 'universal binary'.
> 

The error from the Mac Mini 2,1 (Intel Core 2 Duo) which does run 64 bit code such as VLC and Handbrake X86_64 versions reads as such:

"Check with the developer to make sure OpenCPN works with this version of Mac OS X.  You may need to reinstall the application.  Be sure to install any available updates for the application and Mac OS X."
I cannot build the i386 version because wxWidgets 2.9.4 only supports X86_64 and the 2.8.12 (which only supports i386) version of wxWidgets is very buggy for the more Modern OS X operating systems.

>> Do you suppose it could not find what it needs to build the 10.6 64 bit
>> binaries?  Would it give some kind of error message if it could not find
>> the 10.6 SDK?
>> Do I have to tell it were to find the 10.6 SDK?
> 
> Generally, you don't need to use the 10.6 SDK to deploy to 10.6.  That's what the deployment target is for.  This has been discussed many times on may lists.  ex:
> <http://www.clarkcox.com/blog/2009/06/23/sdks-and-deployment-targets/>

I read the whole page at the Web link you mentioned but it does not apply to this problem as it does not use Cmake and the article is over 3 years old which makes it obsolete.
> 
>> So many questions, and no answers on the cmake Website.
> 
> Well, these are perhaps more OS X questions... you'd have many of the same issues using Xcode directly.
I disagree, this is a Cmake problem.  The Wiki does not even mention these variables, nor is there any direction on how to properly use them anywhere on their web pages.

> 
> Cheers,
> 
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
> 
> 

Thanks,
Ed



More information about the CMake mailing list