MantisBT - CMake
View Issue Details
0015469CMakeCMakepublic2015-03-23 11:462015-11-02 09:13
Abigail Bunyan 
 
normalfeatureN/A
closedno change required 
Apple MacOS X10.10.2
CMake 3.2.1 
 
0015469: Xcode projects misuses targets for ALL_BUILD; it should use a scheme instead
When generating an Xcode project from a CMakeLists.txt with one target, the resultant project contains three targets: the user's target, ALL_BUILD, and ZERO_CHECK. It then makes all targets depend on ZERO_CHECK, and makes ALL_BUILD depend on all other targets.

However, the Xcode documentation specifies "Projects can contain one or more targets, each of which produces one product." - so ALL_BUILD is not the intended use of targets. CMake should instead create an Xcode scheme, which depends on all of the user's Xcode targets.
Debatably, ZERO_CHECK shouldn't be a target - and ZERO_CHECK's only build phase should instead be a build phase present in every other target. However, you could argue that it does produce a product (ie. the Xcode project itself).
Xcode
related to 0015441closed Gregor Jasny Xcode generator does not generate scheme 
Issue History
2015-03-23 11:46Abigail BunyanNew Issue
2015-03-23 11:46Abigail BunyanTag Attached: Xcode
2015-03-23 11:47Abigail BunyanNote Added: 0038277
2015-03-23 11:51Brad KingRelationship addedrelated to 0015441
2015-03-23 11:54Brad KingNote Added: 0038278
2015-03-23 11:55Brad KingStatusnew => resolved
2015-03-23 11:55Brad KingResolutionopen => no change required
2015-11-02 09:13Robert MaynardNote Added: 0039743
2015-11-02 09:13Robert MaynardStatusresolved => closed

Notes
(0038277)
Abigail Bunyan   
2015-03-23 11:47   
(Presumably related to 0015441.)
(0038278)
Brad King   
2015-03-23 11:54   
The Xcode documentation quoted in the description is a high-level conceptual description, not an authoritative definition. Not all targets produce a product. Any add_custom_target call in CMake code will generate a target much like ALL_BUILD and ZERO_CHECK containing the specified custom commands.

ZERO_CHECK needs to be a separate target on which all other depend so that its check runs exactly once even in a parallel build.

This is all working as designed and intended.
(0039743)
Robert Maynard   
2015-11-02 09:13   
Closing resolved issues that have not been updated in more than 4 months.