diff options
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 0a2b32b..13ed143 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -876,10 +876,20 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath( ext = realExt.substr(1); } - std::string sourcecode = GetSourcecodeValueFromFileExtension(ext, lang); - - fileRef->AddAttribute("explicitFileType", - this->CreateString(sourcecode.c_str())); + // If fullpath references a directory, then we need to specify + // lastKnownFileType as folder in order for Xcode to be able to open the + // contents of the folder (Xcode 4.6 does not like explicitFileType=folder). + if(cmSystemTools::FileIsDirectory(fullpath.c_str())) + { + fileRef->AddAttribute("lastKnownFileType", + this->CreateString("folder")); + } + else + { + std::string sourcecode = GetSourcecodeValueFromFileExtension(ext, lang); + fileRef->AddAttribute("explicitFileType", + this->CreateString(sourcecode.c_str())); + } // Store the file path relative to the top of the source tree. std::string path = this->RelativeToSource(fullpath.c_str()); @@ -976,6 +986,11 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, continue; } + if(cmtarget.GetType() == cmTarget::INTERFACE_LIBRARY) + { + continue; + } + if(cmtarget.GetType() == cmTarget::UTILITY || cmtarget.GetType() == cmTarget::GLOBAL_TARGET) { @@ -1004,7 +1019,8 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, cmTarget::SourceFileFlags tsFlags = cmtarget.GetTargetSourceFileFlags(*i); - if(strcmp(filetype->GetString(), "compiled.mach-o.objfile") == 0) + if(filetype && + strcmp(filetype->GetString(), "compiled.mach-o.objfile") == 0) { externalObjFiles.push_back(xsf); } @@ -1686,6 +1702,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, cmXCodeObject* buildSettings, const char* configName) { + if(target.GetType() == cmTarget::INTERFACE_LIBRARY) + { + return; + } + std::string flags; std::string defFlags; bool shared = ((target.GetType() == cmTarget::SHARED_LIBRARY) || @@ -2550,6 +2571,10 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget, cmXCodeObject* buildPhases) { + if(cmtarget.GetType() == cmTarget::INTERFACE_LIBRARY) + { + return 0; + } cmXCodeObject* target = this->CreateObject(cmXCodeObject::PBXNativeTarget); target->AddAttribute("buildPhases", buildPhases); @@ -2756,6 +2781,10 @@ void cmGlobalXCodeGenerator ::AddDependAndLinkInformation(cmXCodeObject* target) { cmTarget* cmtarget = target->GetTarget(); + if(cmtarget->GetType() == cmTarget::INTERFACE_LIBRARY) + { + return; + } if(!cmtarget) { cmSystemTools::Error("Error no target on xobject\n"); @@ -2867,7 +2896,8 @@ void cmGlobalXCodeGenerator { linkLibs += this->XCodeEscapePath(li->Value.c_str()); } - else + else if (!li->Target + || li->Target->GetType() != cmTarget::INTERFACE_LIBRARY) { linkLibs += li->Value; } @@ -2909,6 +2939,10 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, { continue; } + if(cmtarget.GetType() == cmTarget::INTERFACE_LIBRARY) + { + continue; + } // add the soon to be generated Info.plist file as a source for a // MACOSX_BUNDLE file @@ -3648,7 +3682,6 @@ void cmGlobalXCodeGenerator::GetDocumentation(cmDocumentationEntry& entry) { entry.Name = cmGlobalXCodeGenerator::GetActualName(); entry.Brief = "Generate Xcode project files."; - entry.Full = ""; } //---------------------------------------------------------------------------- |