[CMake] [MacOSX] How to compile for certain SDK?

Michael Wild themiwi at gmail.com
Mon Jul 20 07:44:15 EDT 2009


On 20. Jul, 2009, at 13:22, Steven Van Ingelgem wrote:

> Hi,
>
>
> I checked and in Darwin.cmake there are several items like
> "CMAKE_OSX_ARCHITECTURES_DEFAULT" and
> "CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT"... But...
> I can't set them properly in my own CMakeLists.txt file. As such,  
> when I set
> the minimum version to 10.4, it still will try to compile against  
> v10.5 of
> the SDK...
>
> Is there a way to set all of this properly or do I need to fiddle  
> with the
> C/CXX make flags (bah)?
>
>
> Thanks,
> Steven

The variables are CMAKE_OSX_ARCHITECTURES, CMAKE_OSX_DEPLOYMENT_TARGET  
and CMAKE_OSX_SYSROOT. The ones you mentioned are the defaults to pre- 
populate the cache and get assigned to the variables I mentioned  
before you have any chance of changing them.

However, I strongly advice NOT to set them in your CMakeLists.txt,  
unless it really is required. Let the user set those variables in the  
cache.

Michael


More information about the CMake mailing list