[Cmake-commits] [cmake-commits] david.cole committed cmGlobalXCodeGenerator.cxx 1.198 1.199
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri Sep 5 15:51:21 EDT 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv12944/Source
Modified Files:
cmGlobalXCodeGenerator.cxx
Log Message:
BUG: Fix issue #7046 - make sure extensionless headers and resource files work with the Xcode generator. Also fix incorrect mappings in the lastKnownFileType code. Add some extensionless files to the Framework test.
Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.198
retrieving revision 1.199
diff -C 2 -d -r1.198 -r1.199
*** cmGlobalXCodeGenerator.cxx 2 Sep 2008 16:06:31 -0000 1.198
--- cmGlobalXCodeGenerator.cxx 5 Sep 2008 19:51:19 -0000 1.199
***************
*** 527,530 ****
--- 527,531 ----
buildFile->AddAttribute("settings", settings);
fileRef->AddAttribute("fileEncoding", this->CreateString("4"));
+
const char* lang =
this->CurrentLocalGenerator->GetSourceFileLanguage(*sf);
***************
*** 532,535 ****
--- 533,537 ----
std::string ext = sf->GetExtension();
ext = cmSystemTools::LowerCase(ext);
+
if(ext == "o")
{
***************
*** 542,546 ****
else if(ext == "m")
{
! sourcecode += ".cpp.objc";
}
else if(ext == "plist")
--- 544,548 ----
else if(ext == "m")
{
! sourcecode += ".c.objc";
}
else if(ext == "plist")
***************
*** 548,574 ****
sourcecode += ".text.plist";
}
! else if(!lang)
! {
! sourcecode += ext;
! sourcecode += ".";
! sourcecode += ext;
! }
! else if(strcmp(lang, "C") == 0)
{
! sourcecode += ".c.c";
}
! else if(strcmp(lang, "CXX") == 0)
{
sourcecode += ".cpp.cpp";
}
! else
{
! sourcecode += ext;
! sourcecode += ".";
! sourcecode += ext;
}
fileRef->AddAttribute("lastKnownFileType",
this->CreateString(sourcecode.c_str()));
! std::string path =
this->ConvertToRelativeForXCode(sf->GetFullPath().c_str());
std::string dir;
--- 550,585 ----
sourcecode += ".text.plist";
}
! else if(ext == "h" || ext == "hxx" || ext == "hpp")
{
! const char* linkLanguage = cmtarget.GetLinkerLanguage(this);
! if(linkLanguage && (std::string(linkLanguage) == "CXX"))
! {
! sourcecode += ".cpp.h";
! }
! else
! {
! sourcecode += ".c.h";
! }
}
! else if(lang && strcmp(lang, "CXX") == 0)
{
sourcecode += ".cpp.cpp";
}
! else if(lang && strcmp(lang, "C") == 0)
{
! sourcecode += ".c.c";
}
+ //else
+ // {
+ // // Already specialized above or we leave sourcecode == "sourcecode"
+ // // which is probably the most correct choice. Extensionless headers,
+ // // for example... Or file types unknown to Xcode that do not map to a
+ // // valid lastKnownFileType value.
+ // }
+
fileRef->AddAttribute("lastKnownFileType",
this->CreateString(sourcecode.c_str()));
!
! std::string path =
this->ConvertToRelativeForXCode(sf->GetFullPath().c_str());
std::string dir;
***************
*** 576,580 ****
cmSystemTools::SplitProgramPath(sf->GetFullPath().c_str(),
dir, file);
!
fileRef->AddAttribute("name", this->CreateString(file.c_str()));
fileRef->AddAttribute("path", this->CreateString(path.c_str()));
--- 587,591 ----
cmSystemTools::SplitProgramPath(sf->GetFullPath().c_str(),
dir, file);
!
fileRef->AddAttribute("name", this->CreateString(file.c_str()));
fileRef->AddAttribute("path", this->CreateString(path.c_str()));
***************
*** 591,594 ****
--- 602,606 ----
fileRef->AddAttribute("sourceTree", this->CreateString("<absolute>"));
}
+
return buildFile;
}
***************
*** 694,698 ****
externalObjFiles.push_back(xsf);
}
! else if((*i)->GetPropertyAsBool("HEADER_FILE_ONLY"))
{
headerFiles.push_back(xsf);
--- 706,712 ----
externalObjFiles.push_back(xsf);
}
! else if((*i)->GetPropertyAsBool("HEADER_FILE_ONLY") ||
! (tsFlags.Type == cmTarget::SourceFileTypePrivateHeader) ||
! (tsFlags.Type == cmTarget::SourceFileTypePublicHeader))
{
headerFiles.push_back(xsf);
More information about the Cmake-commits
mailing list