MantisBT - CMake
View Issue Details
0014947CMakeCMakepublic2014-05-30 06:442016-05-02 08:30
norbert.nemec 
Gregor Jasny 
normalmajoralways
closedfixed 
 
CMake 3.5CMake 3.5 
0014947: [variant=...] hack works for XCODE_ATTRIBUTE_* but not for CMAKE_XCODE_ATTRIBUTE_*
The issue filed in 0012532 is fixed in commit 332350b9 for XCODE_ATTRIBUTE_* settings. However, it would be expected to work in just the same way for CMAKE_XCODE_ATTRIBUTE_* settings.

These are handled in the same source file (cmGlobalXCodeGenerator.cxx) several pages below. It should be possible to apply the same workaround at that location as well.
No tags attached.
diff cmake-14947.diff (4,050) 2014-10-22 07:31
https://public.kitware.com/Bug/file/5282/cmake-14947.diff
patch 0001-Xcode-Factor-out-XCODE_ATTRIBUTE_-variant-filter-14947.patch (4,499) 2014-10-22 10:37
https://public.kitware.com/Bug/file/5284/0001-Xcode-Factor-out-XCODE_ATTRIBUTE_-variant-filter-14947.patch
Issue History
2014-05-30 06:44norbert.nemecNew Issue
2014-06-02 11:10Brad KingNote Added: 0036099
2014-06-03 03:21norbert.nemecNote Added: 0036100
2014-06-03 08:54Brad KingStatusnew => backlog
2014-10-22 06:34Gregor JasnyNote Added: 0037061
2014-10-22 06:38Gregor JasnyNote Added: 0037062
2014-10-22 07:31Gregor JasnyFile Added: cmake-14947.diff
2014-10-22 10:37Brad KingFile Added: 0001-Xcode-Factor-out-XCODE_ATTRIBUTE_-variant-filter-14947.patch
2014-10-22 10:39Brad KingNote Added: 0037066
2014-10-22 11:09tim blechmannNote Added: 0037067
2014-10-22 11:10Brad KingNote Added: 0037068
2014-10-22 11:19tim blechmannNote Added: 0037069
2015-12-30 08:38Gregor JasnyAssigned To => Gregor Jasny
2015-12-30 08:38Gregor JasnyStatusbacklog => assigned
2016-01-02 11:39Gregor JasnyNote Added: 0040040
2016-01-03 16:36Gregor JasnyNote Added: 0040045
2016-01-07 13:30Brad KingNote Added: 0040145
2016-01-07 13:30Brad KingStatusassigned => resolved
2016-01-07 13:30Brad KingResolutionopen => fixed
2016-01-07 13:30Brad KingFixed in Version => CMake 3.5
2016-01-07 13:30Brad KingTarget Version => CMake 3.5
2016-05-02 08:30Robert MaynardNote Added: 0040992
2016-05-02 08:30Robert MaynardStatusresolved => closed

Notes
(0036099)
Brad King   
2014-06-02 11:10   
Thanks for pointing this out. Do you mind working on a patch that factors the logic out into a helper function for use in both places?
(0036100)
norbert.nemec   
2014-06-03 03:21   
Sorry, I can't really afford getting into cmake coding - I'm fighting on too many fronts already...
(0037061)
Gregor Jasny   
2014-10-22 06:34   
I just wanted to implement this missing feature but in my test case adding variants to CMAKE_XCODE_ATTRIBUTE_xxx already works with cmake 3.0.1

Could you please verify?
(0037062)
Gregor Jasny   
2014-10-22 06:38   
Please disregard my last comment. I was under the impression that adding [foo=bar] generally does not work. Will try to come up with a patch.
(0037066)
Brad King   
2014-10-22 10:39   
Re 0014947:0037062: Thanks for working on a patch. I've revised it slightly as "0001-Xcode-Factor-out-XCODE_ATTRIBUTE_-variant-filter-14947.patch". (BTW, please use "git format-patch" to create patches that can be applied easily.)

The remaining issue is that the place that handles CMAKE_XCODE_ATTRIBUTE_*:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalXCodeGenerator.cxx;hb=v3.0.2#l3379 [^]

is writing to a part of the Xcode project file that is not specific to any configuration. Additional work will be needed to put non-variant attributes in the settings where they are now, and variant-specific attributes in project-wide per-configuration settings.
(0037067)
tim blechmann   
2014-10-22 11:09   
btw, the CMAKE_XCODE_ATTRIBUTE_ variable is undocumented, only the XCODE_ATTRIBUTE_ property is. so i wonder, since this patch allows the use of the variable, would it make sense to make it an 'official' API and add it to the docs?
(0037068)
Brad King   
2014-10-22 11:10   
Re 0014947:0037067: I just added the docs today. See 0015215:0037063.
(0037069)
tim blechmann   
2014-10-22 11:19   
:D
(0040040)
Gregor Jasny   
2016-01-02 11:39   
Picking up this topic, again.
(0040045)
Gregor Jasny   
2016-01-03 16:36   
Created topic xcode-global-attribute-variant and merged into next.
(0040145)
Brad King   
2016-01-07 13:30   
Re 0014947:0040045: Thanks. The changes are:

 Xcode: Factor out XCODE_ATTRIBUTE_ variant filter
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28db2268 [^]

 Xcode: Make CMAKE_XCODE_ATTRIBUTE calculation last step
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28f98cee [^]

 Xcode: Store configuration name along with XcodeObject
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc0ddb9e [^]

 Xcode: Parse variant and genex for CMAKE_XCODE_ATTRIBUTE
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d8bc26a0 [^]
(0040992)
Robert Maynard   
2016-05-02 08:30   
Closing resolved issues that have not been updated in more than 4 months.