MantisBT - CMake
View Issue Details
0015817CMakeCMakepublic2015-10-28 18:592016-05-02 08:30
Laurent Demailly 
Gregor Jasny 
normaltweakalways
closedfixed 
MacDarwin/Mac OS X10.10.5
CMake 3.3.2 
CMake 3.5 
0015817: XCode generated profiles for xcode 7.1 gets warning: Turn on "Enable Testability" When Debugging
cmake version 3.4.20151028-g2fd5fd

macos 10.10.5

xcode 7.1 (7B91b)


When opening the project you get a warning 'Turn on "Enable Testability" When Debugging'

cmake version 3.4.20151028-g2fd5fd (today's git trunk)

macos 10.10.5

xcode 7.1 (7B91b)


cmake ../wdt -G Xcode -DBUILD_TESTING=1
No tags attached.
Issue History
2015-10-28 18:59Laurent DemaillyNew Issue
2015-10-29 08:24Brad KingAssigned To => Gregor Jasny
2015-10-29 08:24Brad KingStatusnew => assigned
2015-10-29 16:40Gregor JasnyNote Added: 0039705
2015-10-29 17:33Gregor JasnyNote Added: 0039706
2015-10-29 17:34Gregor JasnyNote Edited: 0039706bug_revision_view_page.php?bugnote_id=39706#r1940
2015-10-30 08:49Brad KingNote Added: 0039709
2015-11-13 08:25Gregor JasnyStatusassigned => resolved
2015-11-13 08:25Gregor JasnyFixed in Version => CMake 3.5
2015-11-13 08:25Gregor JasnyResolutionopen => fixed
2015-11-13 08:27Brad KingNote Added: 0039869
2016-05-02 08:30Robert MaynardNote Added: 0040960
2016-05-02 08:30Robert MaynardStatusresolved => closed

Notes
(0039705)
Gregor Jasny   
2015-10-29 16:40   
Diff in Xcode project after upgrade:
@@ -3255,6 +3256,7 @@
         91E22C98754C40059A395810 /* Debug */ = {
             isa = XCBuildConfiguration;
             buildSettings = {
+				ENABLE_TESTABILITY = YES;
                 ONLY_ACTIVE_ARCH = YES;
                 SDKROOT = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk;
                 
SYMROOT = /Users/jasny/src/wdt/_build/build;
(0039706)
Gregor Jasny   
2015-10-29 17:33   
(edited on: 2015-10-29 17:34)
Xcode expects the "Testability" attribute to be set in the Debug configuration. The best thing would be if the Xcode SDKs would provide these settings by default.

The problem I see here is that 'Debug' is a arbitrary configuration. So I'm a little bit reluctant to set it by default. With 0014947 fixed you would be able to set it in the project itself:

set(CMAKE_XCODE_ATTRIBUTE_ENABLE_TESTABILITY[variant=Debug] "YES")


Another option would be to set LastUpgradeCheck to 710 to prevent the notification.
@@ -1145,6 +1145,7 @@
             isa = PBXProject;
             attributes = {
                 BuildIndependentTargetsInParallel = YES;
+				LastUpgradeCheck = 0710;
             };
             buildConfigurationList = 35CF513637874DB691923438 /* Build configuration list for PBXProject 
"WDT" */;
             compatibilityVersion = "Xcode 3.2";


Brad, what do you think?

PS: This setting seems to make only a difference for Swift

(0039709)
Brad King   
2015-10-30 08:49   
Re 0015817:0039706: Since our Xcode project files are generated there is no need for them ever to be upgraded automatically by Xcode. Any updates that are needed should be taught to CMake's generator. Therefore I think we should always generate LastUpgradeCheck to match the version of Xcode for which we are generating. Thanks!
(0039869)
Brad King   
2015-11-13 08:27   
Fix is here:

 Xcode: Set LastUpgradeCheck to current Xcode version
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=13610474 [^]
(0040960)
Robert Maynard   
2016-05-02 08:30   
Closing resolved issues that have not been updated in more than 4 months.