View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013082CMakeCMakepublic2012-03-30 17:232012-09-03 16:02
ReporterMichael Toy 
Assigned ToDavid Cole 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformApple MacOSOS XOS Version10.4.10
Product VersionCMake 2.8.7 
Target VersionCMake 2.8.8Fixed in VersionCMake 2.8.8 
Summary0013082: Projects without a build configuration called "Debug" do not load in XCode 4.3
DescriptionIf CMAKE_CONFIGURATION_TYPES does not include a configuration called "Debug", then the generated XCode project will not load in XCode 4.3.

You get the message: "Project *mumble*.xcodeproj cannot be opened: The project contains has no default build configuration - it may have been damaged"

Examining the project file, I see this reference to a non existent configuration "Debug", which, if I edit by hand to a legal configuration, allows XCode 4.3 to open the project.

/* Begin XCConfigurationList section */
              112307722465449CAB35CE62 /* Build configuration list for PBXProject "MUMBLE" */ = {
                     isa = XCConfigurationList;
                     buildConfigurations = (
                            405A72F866C04328BAC5995E /* Release */,
                            4337EF4DA71245D9A159CB90 /* Instrumented */,
                     );
                     defaultConfigurationIsVisible = 0;
                     defaultConfigurationName = Debug;
              };

Which is caused by these lines in cmGlobalXCodeGenerator.cxx
( from method cmGlobalXCodeGenerator::CreateXCodeObjects )

  std::string comment = "Build configuration list for PBXProject ";
  comment += " \"";
  comment += this->CurrentProject;
  comment += "\"";
  configlist->SetComment(comment.c_str());
  configlist->AddAttribute("defaultConfigurationIsVisible",
                           this->CreateString("0"));
  configlist->AddAttribute("defaultConfigurationName",
                           this->CreateString("Debug"));
TagsNo tags attached.
Attached Files

 Relationships
related to 0012621closedDavid Cole Compatibility with Xcode 4.3 

  Notes
(0029018)
Michael Toy (reporter)
2012-03-30 17:57

Here's a diff for a patch which seems to fix the problem, but I not not familiar enough with the code to know if this is a good, leak free, crash safe fix.

Index: Source/cmGlobalXCodeGenerator.cxx
===================================================================
--- Source/cmGlobalXCodeGenerator.cxx (revision 106760)
+++ Source/cmGlobalXCodeGenerator.cxx (working copy)
@@ -2888,6 +2888,7 @@
   cmXCodeObject* buildConfigurations =
     this->CreateObject(cmXCodeObject::OBJECT_LIST);
   std::vector<cmXCodeObject*> configs;
+ const char *defaultconfigname = "Debug";
   if(this->XcodeVersion == 15)
     {
     cmXCodeObject* configDebug =
@@ -2904,6 +2905,10 @@
     for(unsigned int i = 0; i < this->CurrentConfigurationTypes.size(); ++i)
       {
       const char* name = this->CurrentConfigurationTypes[i].c_str();
+ if( i == 0 )
+ {
+ defaultconfigname = name;
+ }
       cmXCodeObject* config =
         this->CreateObject(cmXCodeObject::XCBuildConfiguration);
       config->AddAttribute("name", this->CreateString(name));
@@ -2925,7 +2930,7 @@
   configlist->AddAttribute("defaultConfigurationIsVisible",
                            this->CreateString("0"));
   configlist->AddAttribute("defaultConfigurationName",
- this->CreateString("Debug"));
+ this->CreateString(defaultconfigname));
   cmXCodeObject* buildSettings =
       this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
   const char* osxArch =
(0029059)
David Cole (manager)
2012-04-02 16:01

Fixed by this commit, just merged to 'next':

  http://public.kitware.com/gitweb?p=cmake.git;a=commitdiff;h=0579fa045c854b732506887cdf3a9a54610748ab [^]

Thanks for the suggested patch!
(0030888)
David Cole (manager)
2012-09-03 16:02

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-03-30 17:23 Michael Toy New Issue
2012-03-30 17:57 Michael Toy Note Added: 0029018
2012-04-02 08:38 Brad King Relationship added related to 0012621
2012-04-02 08:39 Brad King Assigned To => David Cole
2012-04-02 08:39 Brad King Status new => assigned
2012-04-02 16:01 David Cole Note Added: 0029059
2012-04-02 16:01 David Cole Status assigned => resolved
2012-04-02 16:01 David Cole Resolution open => fixed
2012-04-19 15:55 David Cole Fixed in Version => CMake 2.8.8
2012-04-19 15:55 David Cole Target Version => CMake 2.8.8
2012-09-03 16:02 David Cole Note Added: 0030888
2012-09-03 16:02 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team