[CMake] Separating SET_TARGET_PROPERTIES() for different configurations

Michael Wild themiwi at gmail.com
Thu Oct 13 08:52:39 EDT 2011


On 10/13/2011 02:26 PM, Daniel Dekkers wrote:
> Hi,
> 
> How can I separate settings for different configurations in Xcode.
> 
> As an example...
> 
> 		SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS} )
> 
> ... sets the same entitlement file for all four configurations (Debug, Release, MinSizeRel, RelWithDebInfo) to ${IOS_CODE_SIGN_ENTITLEMENTS}. 
> 
> But now i would like to use different different files for different configurations, something like this:
> 
> 		SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES LINK_FLAG_DEBUG XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS_DEBUG} )
> 		SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES LINK_FLAG_RELEASE XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS_ADHOC} )
> 		SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES LINK_FLAG_MINSIZEREL XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS_DISTRIBUTION} )
> 		SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES LINK_FLAG_RELWITHDEBINFO XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS_DEBUG} )
> 
> But this syntax is not recognized.
> 
> Kind Regards, 
> 
> Daniel Dekkers


You can use XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=Debug] etc.
See
http://stackoverflow.com/questions/1354542/how-to-set-an-xcode-attribute-in-cmake-for-a-specific-configuration.
Wonder why this didn't make it into the documentation. But then,
googling XCODE_ATTRIBUTE returned this find pretty high up in the search
results...

Michael


More information about the CMake mailing list