[CMake] Separating SET_TARGET_PROPERTIES() for different configurations
Daniel Dekkers
d.dekkers at cthrough.nl
Thu Oct 13 09:23:32 EDT 2011
Thanks Michael,
Just found it out myself as well (and yes, XCODE_ATTRIBUTE was the google entry).
SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=Debug] ${RT_IOS_CODE_SIGN_ENTITLEMENTS_DEBUG} )
SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=Release] ${RT_IOS_CODE_SIGN_ENTITLEMENTS_ADHOC} )
SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=RelWithDebInfo] ${RT_IOS_CODE_SIGN_ENTITLEMENTS_DISTRIBUTION} )
SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=MinSizeRel] ${RT_IOS_CODE_SIGN_ENTITLEMENTS_DISTRIBUTION} )
But now I get four "Any SDK" entries inside each of the four different configurations (16 in total), the list of "Any SDK"'s containing the different entitlement entries.
So...
Code Signing Entitlements
Debug
Any SDK path/to/.../EntitlementsAdHoc.plist
Any SDK path/to/.../EntitlementsDistribution.plist
Any SDK path/to/.../EntitlementsDebug.plist
Any SDK path/to/.../EntitlementsDistribution.plist
MinSizeRel
Any SDK path/to/.../EntitlementsAdHoc.plist
Any SDK path/to/.../EntitlementsDistribution.plist
Any SDK path/to/.../EntitlementsDebug.plist
Any SDK path/to/.../EntitlementsDistribution.plist
RelWithDebInfo
Any SDK path/to/.../EntitlementsAdHoc.plist
Any SDK path/to/.../EntitlementsDistribution.plist
Any SDK path/to/.../EntitlementsDebug.plist
Any SDK path/to/.../EntitlementsDistribution.plist
Release
Any SDK path/to/.../EntitlementsAdHoc.plist
Any SDK path/to/.../EntitlementsDistribution.plist
Any SDK path/to/.../EntitlementsDebug.plist
Any SDK path/to/.../EntitlementsDistribution.plist
...while I was hoping for...
Code Signing Entitlements
Debug path/to/.../EntitlementsDebug.plist
MinSizeRel path/to/.../EntitlementsDistribution.plist
RelWithDebInfo path/to/.../EntitlementsDistribution.plist
Release path/to/.../EntitlementsAdHoc.plist
Anyone knows what happening here?
Daniel
On Oct 13, 2011, at 2:52 PM, Michael Wild wrote:
> 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