Index: Source/cmLocalGenerator.cxx =================================================================== RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v retrieving revision 1.284 diff -u -r1.284 cmLocalGenerator.cxx --- Source/cmLocalGenerator.cxx 2 Sep 2008 16:06:32 -0000 1.284 +++ Source/cmLocalGenerator.cxx 19 Sep 2008 15:05:21 -0000 @@ -1658,8 +1658,13 @@ this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT"); const char* sysrootDefault = this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT_DEFAULT"); + const char* deploymentTarget = + this->Makefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); + const char* deploymentTargetDefault = + this->Makefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT"); + bool flagsUsed = false; - if(osxArch && sysroot && lang && (lang[0] =='C' || lang[0] == 'F')) + if(osxArch && sysroot && deploymentTarget && lang && (lang[0] =='C' || lang[0] == 'F')) { std::vector archs; cmSystemTools::ExpandListArgument(std::string(osxArch), @@ -1697,6 +1702,13 @@ flags += " -isysroot "; flags += sysroot; } + + if (deploymentTarget && deploymentTargetDefault && + strcmp (deploymentTarget, deploymentTargetDefault) != 0) + { + flags += " -mmacosx-version-min="; + flags += deploymentTarget; + } } this->AddConfigVariableFlags(flags, flagsVar.c_str(), config); } Index: Source/cmGlobalXCodeGenerator.cxx =================================================================== RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v retrieving revision 1.201 diff -u -r1.201 cmGlobalXCodeGenerator.cxx --- Source/cmGlobalXCodeGenerator.cxx 15 Sep 2008 13:51:47 -0000 1.201 +++ Source/cmGlobalXCodeGenerator.cxx 19 Sep 2008 15:05:20 -0000 @@ -2442,7 +2442,11 @@ this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT"); const char* sysrootDefault = this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT_DEFAULT"); - if(osxArch && sysroot) + const char* deploymentTarget = + this->CurrentMakefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); + const char* deploymentTargetDefault = + this->CurrentMakefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT"); + if(osxArch && sysroot && deploymentTarget) { bool flagsUsed = false; // recompute this as it may have been changed since enable language @@ -2482,6 +2486,12 @@ buildSettings->AddAttribute("SDKROOT", this->CreateString(sysroot)); } + if( deploymentTargetDefault && + strcmp(deploymentTarget, deploymentTargetDefault) != 0) + { + buildSettings->AddAttribute("MACOSX_DEPLOYMENT_TARGET", + this->CreateString(deploymentTarget)); + } } for( std::vector::iterator i = configs.begin(); i != configs.end(); ++i)