|
|
@@ -410,15 +410,17 @@ void cmGlobalXCodeGenerator::Generate()
|
|
|
//----------------------------------------------------------------------------
|
|
|
void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root)
|
|
|
{
|
|
|
- this->CurrentProject = root->GetMakefile()->GetProjectName();
|
|
|
+ this->CurrentProject = root->GetProjectName();
|
|
|
this->SetCurrentLocalGenerator(root);
|
|
|
- cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentSourceDirectory(),
|
|
|
- this->ProjectSourceDirectoryComponents);
|
|
|
- cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentBinaryDirectory(),
|
|
|
- this->ProjectOutputDirectoryComponents);
|
|
|
+ cmSystemTools::SplitPath(
|
|
|
+ this->CurrentLocalGenerator->GetCurrentSourceDirectory(),
|
|
|
+ this->ProjectSourceDirectoryComponents);
|
|
|
+ cmSystemTools::SplitPath(
|
|
|
+ this->CurrentLocalGenerator->GetCurrentBinaryDirectory(),
|
|
|
+ this->ProjectOutputDirectoryComponents);
|
|
|
|
|
|
this->CurrentXCodeHackMakefile =
|
|
|
- root->GetMakefile()->GetCurrentBinaryDirectory();
|
|
|
+ root->GetCurrentBinaryDirectory();
|
|
|
this->CurrentXCodeHackMakefile += "/CMakeScripts";
|
|
|
cmSystemTools::MakeDirectory(this->CurrentXCodeHackMakefile.c_str());
|
|
|
this->CurrentXCodeHackMakefile += "/XCODE_DEPEND_HELPER.make";
|
|
|
@@ -460,13 +462,13 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
|
|
|
mf->AddGeneratorTarget(allbuild, allBuildGt);
|
|
|
|
|
|
// Refer to the main build configuration file for easy editing.
|
|
|
- std::string listfile = mf->GetCurrentSourceDirectory();
|
|
|
+ std::string listfile = root->GetCurrentSourceDirectory();
|
|
|
listfile += "/";
|
|
|
listfile += "CMakeLists.txt";
|
|
|
allBuildGt->AddSource(listfile.c_str());
|
|
|
|
|
|
// Add XCODE depend helper
|
|
|
- std::string dir = mf->GetCurrentBinaryDirectory();
|
|
|
+ std::string dir = root->GetCurrentBinaryDirectory();
|
|
|
cmCustomCommandLine makeHelper;
|
|
|
if(this->XcodeVersion < 50)
|
|
|
{
|
|
|
@@ -556,7 +558,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
|
|
|
cmGeneratorTarget* targetGT = this->GetGeneratorTarget(&target);
|
|
|
|
|
|
// Refer to the build configuration file for easy editing.
|
|
|
- listfile = lg->GetMakefile()->GetCurrentSourceDirectory();
|
|
|
+ listfile = lg->GetCurrentSourceDirectory();
|
|
|
listfile += "/";
|
|
|
listfile += "CMakeLists.txt";
|
|
|
targetGT->AddSource(listfile.c_str());
|
|
|
@@ -568,7 +570,6 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
|
|
|
void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
|
|
|
cmLocalGenerator* root, std::vector<cmLocalGenerator*> const& gens)
|
|
|
{
|
|
|
- cmMakefile* mf = root->GetMakefile();
|
|
|
std::vector<std::string> lfiles;
|
|
|
for(std::vector<cmLocalGenerator*>::const_iterator gi = gens.begin();
|
|
|
gi != gens.end(); ++gi)
|
|
|
@@ -582,7 +583,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
|
|
|
std::vector<std::string>::iterator new_end =
|
|
|
std::unique(lfiles.begin(), lfiles.end());
|
|
|
lfiles.erase(new_end, lfiles.end());
|
|
|
- this->CurrentReRunCMakeMakefile = mf->GetCurrentBinaryDirectory();
|
|
|
+ this->CurrentReRunCMakeMakefile = root->GetCurrentBinaryDirectory();
|
|
|
this->CurrentReRunCMakeMakefile += "/CMakeScripts";
|
|
|
cmSystemTools::MakeDirectory(this->CurrentReRunCMakeMakefile.c_str());
|
|
|
this->CurrentReRunCMakeMakefile += "/ReRunCMake.make";
|
|
|
@@ -590,7 +591,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
|
|
|
(this->CurrentReRunCMakeMakefile.c_str());
|
|
|
makefileStream.SetCopyIfDifferent(true);
|
|
|
makefileStream << "# Generated by CMake, DO NOT EDIT\n";
|
|
|
- std::string checkCache = mf->GetHomeOutputDirectory();
|
|
|
+ std::string checkCache = root->GetBinaryDirectory();
|
|
|
checkCache += "/";
|
|
|
checkCache += cmake::GetCMakeFilesDirectoryPostSlash();
|
|
|
checkCache += "cmake.check_cache";
|
|
|
@@ -604,9 +605,9 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
|
|
|
makefileStream << "\n\t" <<
|
|
|
this->ConvertToRelativeForMake(cmSystemTools::GetCMakeCommand().c_str())
|
|
|
<< " -H" << this->ConvertToRelativeForMake(
|
|
|
- mf->GetHomeDirectory())
|
|
|
+ root->GetSourceDirectory())
|
|
|
<< " -B" << this->ConvertToRelativeForMake(
|
|
|
- mf->GetHomeOutputDirectory()) << "\n";
|
|
|
+ root->GetBinaryDirectory()) << "\n";
|
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
@@ -1033,7 +1034,7 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
|
|
|
this->CurrentLocalGenerator = gen;
|
|
|
this->CurrentMakefile = gen->GetMakefile();
|
|
|
std::string outdir =
|
|
|
- cmSystemTools::CollapseFullPath(this->CurrentMakefile->
|
|
|
+ cmSystemTools::CollapseFullPath(this->CurrentLocalGenerator->
|
|
|
GetCurrentBinaryDirectory());
|
|
|
cmSystemTools::SplitPath(outdir.c_str(),
|
|
|
this->CurrentOutputDirectoryComponents);
|
|
|
@@ -1389,7 +1390,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
|
|
|
// linker language. This should convince Xcode to choose the proper
|
|
|
// language.
|
|
|
cmMakefile* mf = cmtarget.GetMakefile();
|
|
|
- std::string fname = mf->GetCurrentBinaryDirectory();
|
|
|
+ std::string fname = gtgt->GetLocalGenerator()->GetCurrentBinaryDirectory();
|
|
|
fname += cmake::GetCMakeFilesDirectory();
|
|
|
fname += "/";
|
|
|
fname += cmtarget.GetName();
|
|
|
@@ -1618,7 +1619,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
|
|
|
const & commands,
|
|
|
const char* name)
|
|
|
{
|
|
|
- std::string dir = this->CurrentMakefile->GetCurrentBinaryDirectory();
|
|
|
+ std::string dir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
|
|
|
dir += "/CMakeScripts";
|
|
|
cmSystemTools::MakeDirectory(dir.c_str());
|
|
|
std::string makefile = dir;
|
|
|
@@ -1639,7 +1640,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
|
|
|
currentConfig->c_str());
|
|
|
}
|
|
|
|
|
|
- std::string cdir = this->CurrentMakefile->GetCurrentBinaryDirectory();
|
|
|
+ std::string cdir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
|
|
|
cdir = this->ConvertToRelativeForXCode(cdir.c_str());
|
|
|
std::string makecmd = "make -C ";
|
|
|
makecmd += cdir;
|
|
|
@@ -1967,7 +1968,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
|
|
|
}
|
|
|
|
|
|
// Set attributes to specify the proper name for the target.
|
|
|
- std::string pndir = this->CurrentMakefile->GetCurrentBinaryDirectory();
|
|
|
+ std::string pndir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
|
|
|
if(target.GetType() == cmTarget::STATIC_LIBRARY ||
|
|
|
target.GetType() == cmTarget::SHARED_LIBRARY ||
|
|
|
target.GetType() == cmTarget::MODULE_LIBRARY ||
|
|
|
@@ -3342,7 +3343,7 @@ bool cmGlobalXCodeGenerator
|
|
|
this->RootObject->SetComment("Project object");
|
|
|
|
|
|
std::string project_id = "PROJECT_";
|
|
|
- project_id += root->GetMakefile()->GetProjectName();
|
|
|
+ project_id += root->GetProjectName();
|
|
|
this->RootObject->SetId(this->GetOrCreateId(
|
|
|
project_id.c_str(), this->RootObject->GetId()).c_str());
|
|
|
|
|
|
@@ -3372,7 +3373,7 @@ bool cmGlobalXCodeGenerator
|
|
|
// Point Xcode at the top of the source tree.
|
|
|
{
|
|
|
std::string pdir =
|
|
|
- this->RelativeToBinary(root->GetMakefile()->GetCurrentSourceDirectory());
|
|
|
+ this->RelativeToBinary(root->GetCurrentSourceDirectory());
|
|
|
this->RootObject->AddAttribute("projectDirPath",
|
|
|
this->CreateString(pdir.c_str()));
|
|
|
this->RootObject->AddAttribute("projectRoot", this->CreateString(""));
|
|
|
@@ -3484,7 +3485,7 @@ bool cmGlobalXCodeGenerator
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- std::string symroot = root->GetMakefile()->GetCurrentBinaryDirectory();
|
|
|
+ std::string symroot = root->GetCurrentBinaryDirectory();
|
|
|
symroot += "/build";
|
|
|
buildSettings->AddAttribute("SYMROOT", this->CreateString(symroot.c_str()));
|
|
|
|
|
|
@@ -3727,9 +3728,9 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root,
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
- std::string xcodeDir = root->GetMakefile()->GetCurrentBinaryDirectory();
|
|
|
+ std::string xcodeDir = root->GetCurrentBinaryDirectory();
|
|
|
xcodeDir += "/";
|
|
|
- xcodeDir += root->GetMakefile()->GetProjectName();
|
|
|
+ xcodeDir += root->GetProjectName();
|
|
|
xcodeDir += ".xcode";
|
|
|
if(this->XcodeVersion > 20)
|
|
|
{
|
|
|
@@ -3749,7 +3750,7 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root,
|
|
|
// Since this call may have created new cache entries, save the cache:
|
|
|
//
|
|
|
root->GetMakefile()->GetCMakeInstance()->SaveCache(
|
|
|
- root->GetMakefile()->GetHomeOutputDirectory());
|
|
|
+ root->GetBinaryDirectory());
|
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|