[CMake] xcodeproj internal reference lottery

Bill Hoffman bill.hoffman at kitware.com
Thu Mar 4 08:18:44 EST 2010


hauns at mac.com wrote:
>>>> I can provide assistance if you want to 
>>>> attempt this.
>>>>
>>>> Thanks.
>>>>
>>>> -Bill
> 
> good morning,
> 
> i have downloaded the cmake sources. i see a couple of xcode related
files. by way of a head start, can you provide a few pointers. where is
the hash what variables am i looking for? (don't exhaust yourself)
> 

The place for this to go would be in both cmGlobalXCodeGenerator.cxx and 
cmXCodeObject.cxx.


You should change this method in cmGlobalXCodeGenerator.cxx
cmXCodeObject*
cmXCodeObject*
cmGlobalXCodeGenerator::CreateXCodeFileReference(cmSourceFile* sf,
                                                  cmTarget& cmtarget)

...

  if(!fileRef)
     {
     fileRef = this->CreateObject(cmXCodeObject::PBXFileReference);
     std::string comment = fname;
     //comment += " in ";
     //std::string gname = group->GetObject("name")->GetString();
     //comment += gname.substr(1, gname.size()-2);
     fileRef->SetComment(fname.c_str());
     this->FileRefs[fname] = fileRef;
     fileRef->CreateFileIdHash(fname);  // **** Add this line
     }


Then add the method CreateFileIdHash to cmXCodeObject.(h/cxx).  It 
should set the Id to the string that contains the hash.

I think that should do it.

-Bill


More information about the CMake mailing list