MantisBT - CMake
View Issue Details
0012532CMakeCMakepublic2011-10-21 12:532013-10-07 10:09
Daniel Dekkers 
Brad King 
normalmajoralways
closedfixed 
Apple MacOS X10.4.10
CMake 2.8.6 
CMake 2.8.12CMake 2.8.12 
0012532: Defining different settings for different configurations in Xcode (4.0.2) generator
Setting properties with the [variant=] construction in SET_TARGET_PROPERTIES() gives unexpected results.

As an example:

SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=Debug] "EntitlementsDebug.plist" )
SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=Release] "EntitlementsAdHoc.plist" )

Will fill both configurations (Debug and Release) with both settings (EntitlementsDebug.plist and EntitlementsAdHoc.plist).


The [variant=] construction is undocumented, apart from the bug tracker.

Related to...

http://www.cmake.org/Bug/view.php?id=11667 [^]
http://www.cmake.org/Bug/view.php?id=8179 [^]
No tags attached.
has duplicate 0013201closed David Cole XCODE_ATTRIBUTE_<an attribute>[variant=Debug] does not work as expected 
Issue History
2011-10-21 12:53Daniel DekkersNew Issue
2011-10-22 12:47David ColeTarget Version => CMake 2.8.7
2011-12-13 19:28David ColeNote Added: 0027972
2011-12-13 19:28David ColeTarget VersionCMake 2.8.7 =>
2012-01-07 09:59David ColeTarget Version => CMake 2.8.8
2012-04-19 08:37David ColeTarget VersionCMake 2.8.8 => CMake 2.8.9
2012-05-05 13:38David ColeAssigned To => David Cole
2012-05-05 13:38David ColeStatusnew => assigned
2012-05-08 14:43David ColeRelationship addedhas duplicate 0013201
2012-07-09 07:13David ColeNote Added: 0029990
2012-07-09 07:20David ColeTarget VersionCMake 2.8.9 =>
2012-08-13 15:36David ColeStatusassigned => backlog
2012-08-13 15:36David ColeNote Added: 0030616
2012-08-13 15:37David ColeAssigned ToDavid Cole =>
2012-10-12 08:10KenNote Added: 0031221
2012-10-14 05:37Andrew S.Note Added: 0031227
2012-10-14 05:39Andrew S.Note Edited: 0031227bug_revision_view_page.php?bugnote_id=31227#r857
2012-10-15 09:46KenNote Added: 0031236
2012-10-15 10:05Andrew S.Note Added: 0031238
2012-12-04 10:39Cédric OCHSNote Added: 0031827
2012-12-04 10:40Cédric OCHSNote Edited: 0031827bug_revision_view_page.php?bugnote_id=31827#r962
2012-12-04 12:08Cédric OCHSNote Edited: 0031827bug_revision_view_page.php?bugnote_id=31827#r963
2012-12-04 12:55Cédric OCHSNote Edited: 0031827bug_revision_view_page.php?bugnote_id=31827#r964
2012-12-12 10:42Cédric OCHSNote Edited: 0031827bug_revision_view_page.php?bugnote_id=31827#r972
2013-01-03 05:10Cédric OCHSNote Added: 0031959
2013-05-22 15:52Brad KingNote Added: 0033115
2013-05-22 15:52Brad KingAssigned To => Brad King
2013-05-22 15:52Brad KingStatusbacklog => resolved
2013-05-22 15:52Brad KingResolutionopen => fixed
2013-05-22 15:52Brad KingFixed in Version => CMake 2.8.12
2013-05-22 15:52Brad KingTarget Version => CMake 2.8.12
2013-10-07 10:09Robert MaynardNote Added: 0034056
2013-10-07 10:09Robert MaynardStatusresolved => closed

Notes
(0027972)
David Cole   
2011-12-13 19:28   
Unset target version field; too late for a fix to go into 2.8.7; deferred until a future version.
(0029990)
David Cole   
2012-07-09 07:13   
Unset target version field; too late for a fix to go into 2.8.9; deferred until a future version.
(0030616)
David Cole   
2012-08-13 15:36   
Sending old, not-recently-updated issues to the backlog.

(The age of the bug alone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0031221)
Ken   
2012-10-12 08:10   
Any suggestions for a resolution or workaround for this? It is very frustrating having to manually tweak my project every time I run CMake.
(0031227)
Andrew S.   
2012-10-14 05:37   
(edited on: 2012-10-14 05:39)
This bug is very annoying, but not really hard to fix.

'variant=Debug' is not working any more. I would suggest to use configuration postfixes (_DEBUG, _RELEASE, etc.) like you do for other CMake properties. See modified example below.

# Default property value for all configurations
SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS"EntitlementsAdHoc.plist")

# Change property for 'Debug' configuration only
SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS_DEBUG "EntitlementsDebug.plist")

(0031236)
Ken   
2012-10-15 09:46   
Hi Andrew, this workaround does not work for me in Xcode 4.5.1. Here is the code that I'm using:

  set_target_properties (${NAME} PROPERTIES XCODE_ATTRIBUTE_COPY_PHASE_STRIP YES)
  set_target_properties (${NAME} PROPERTIES XCODE_ATTRIBUTE_COPY_PHASE_STRIP_DEBUG NO)

It simply created a User-Defined variable called COPY_PHASE_STRIP_DEBUG.
(0031238)
Andrew S.   
2012-10-15 10:05   
Ken, this is not workaround. This is my suggestion how it could be fixed by CMake developers.
(0031827)
Cédric OCHS   
2012-12-04 10:39   
(edited on: 2012-12-12 10:42)
Hi,

I'm also interested to support specific Xcode attributes for each configuration, so I wrote a patch :

http://kervala.net/download/cmake-xcode-attributes-variant.patch [^]

This patch is written against last Git revision.

I compiled CMake under Mac OS X and I checked the resulting Xcode project. All seems to be ok :)

I fixed a slight bug in my patch when using XCODE_ATTRIBUTE_ABC[variant=Debug][sdk=*]. It now adds an attribute ABC[sdk=*] only for Debug configuration and nothing for Release configuration.

(0031959)
Cédric OCHS   
2013-01-03 05:10   
Please someone could check my patch and eventually apply it ?

Else I'll need to do a CMake fork which I prefer to avoid :(
(0033115)
Brad King   
2013-05-22 15:52   
Patch applied, thanks:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=332350b9 [^]
(0034056)
Robert Maynard   
2013-10-07 10:09   
Closing resolved issues that have not been updated in more than 4 months.