diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 7da334ef1..e3efcddb1 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -116,7 +116,7 @@ const char* CCONV cmGetProjectName(void *arg) { cmMakefile *mf = static_cast(arg); static std::string name; - name = mf->GetProjectName(); + name = mf->GetStateSnapshot().GetProjectName(); return name.c_str(); } diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 2064ad7c2..ff3d1ee0f 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1975,8 +1975,9 @@ void cmComputeLinkInformation::GetRPath(std::vector& runtimeDirs, else if(use_link_rpath) { // Do not add any path inside the source or build tree. - const char* topSourceDir = this->Makefile->GetHomeDirectory(); - const char* topBinaryDir = this->Makefile->GetHomeOutputDirectory(); + const char* topSourceDir = this->CMakeInstance->GetHomeDirectory(); + const char* topBinaryDir = + this->CMakeInstance->GetHomeOutputDirectory(); if(!cmSystemTools::ComparePath(*ri, topSourceDir) && !cmSystemTools::ComparePath(*ri, topBinaryDir) && !cmSystemTools::IsSubDirectory(*ri, topSourceDir) && diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 7f3b65109..4b6bd5034 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -101,7 +101,7 @@ cmCustomCommandGenerator } else { - cmOutputConverter converter(this->LG->GetMakefile()->GetStateSnapshot()); + cmOutputConverter converter(this->LG->GetStateSnapshot()); cmd += converter.EscapeForShell(arg, this->MakeVars); } } diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 856dcd429..80f560f31 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -160,7 +160,7 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends, if (mod_dir.empty()) { mod_dir = - this->LocalGenerator->GetMakefile()->GetCurrentBinaryDirectory(); + this->LocalGenerator->GetCurrentBinaryDirectory(); } // Actually write dependencies to the streams. diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 881aceee7..c9b6100e1 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -241,12 +241,14 @@ static bool isSubDirectory(const char* a, const char* b) //---------------------------------------------------------------------------- static bool checkInterfaceDirs(const std::string &prepro, - cmTarget *target, const std::string& prop) + cmGeneratorTarget *target, const std::string& prop) { const char* installDir = - target->GetMakefile()->GetSafeDefinition("CMAKE_INSTALL_PREFIX"); - const char* topSourceDir = target->GetMakefile()->GetHomeDirectory(); - const char* topBinaryDir = target->GetMakefile()->GetHomeOutputDirectory(); + target->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX"); + const char* topSourceDir = + target->GetLocalGenerator()->GetSourceDirectory(); + const char* topBinaryDir = + target->GetLocalGenerator()->GetBinaryDirectory(); std::vector parts; cmGeneratorExpression::Split(prepro, parts); @@ -269,7 +271,7 @@ static bool checkInterfaceDirs(const std::string &prepro, { if (prop == "INTERFACE_INCLUDE_DIRECTORIES") { - switch (target->GetPolicyStatusCMP0041()) + switch (target->Target->GetPolicyStatusCMP0041()) { case cmPolicies::WARN: messageType = cmake::WARNING; @@ -298,7 +300,7 @@ static bool checkInterfaceDirs(const std::string &prepro, e << "Target \"" << target->GetName() << "\" " << prop << " property contains relative path:\n" " \"" << *li << "\""; - target->GetMakefile()->IssueMessage(messageType, e.str()); + target->GetLocalGenerator()->IssueMessage(messageType, e.str()); } bool inBinary = isSubDirectory(li->c_str(), topBinaryDir); bool inSource = isSubDirectory(li->c_str(), topSourceDir); @@ -316,7 +318,7 @@ static bool checkInterfaceDirs(const std::string &prepro, { if (!shouldContinue) { - switch(target->GetPolicyStatusCMP0052()) + switch(target->Target->GetPolicyStatusCMP0052()) { case cmPolicies::WARN: { @@ -329,7 +331,7 @@ static bool checkInterfaceDirs(const std::string &prepro, "a subdirectory of the " << (inBinary ? "build" : "source") << " tree:\n \"" << (inBinary ? topBinaryDir : topSourceDir) << "\"" << std::endl; - target->GetMakefile()->IssueMessage(cmake::AUTHOR_WARNING, + target->GetLocalGenerator()->IssueMessage(cmake::AUTHOR_WARNING, s.str()); } case cmPolicies::OLD: @@ -352,7 +354,7 @@ static bool checkInterfaceDirs(const std::string &prepro, e << "Target \"" << target->GetName() << "\" " << prop << " property contains path:\n" " \"" << *li << "\"\nwhich is prefixed in the build directory."; - target->GetMakefile()->IssueMessage(messageType, e.str()); + target->GetLocalGenerator()->IssueMessage(messageType, e.str()); } if (!inSourceBuild) { @@ -361,7 +363,7 @@ static bool checkInterfaceDirs(const std::string &prepro, e << "Target \"" << target->GetName() << "\" " << prop << " property contains path:\n" " \"" << *li << "\"\nwhich is prefixed in the source directory."; - target->GetMakefile()->IssueMessage(messageType, e.str()); + target->GetLocalGenerator()->IssueMessage(messageType, e.str()); } } } @@ -421,7 +423,9 @@ void cmExportFileGenerator::PopulateSourcesInterface( this->ResolveTargetsInGeneratorExpressions(prepro, target, missingTargets); - if (!checkInterfaceDirs(prepro, target, propName)) + cmGeneratorTarget* gt = target->GetMakefile() + ->GetGlobalGenerator()->GetGeneratorTarget(target); + if (!checkInterfaceDirs(prepro, gt, propName)) { return; } @@ -491,7 +495,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( this->ResolveTargetsInGeneratorExpressions(prepro, target->Target, missingTargets); - if (!checkInterfaceDirs(prepro, target->Target, propName)) + if (!checkInterfaceDirs(prepro, target, propName)) { return; } diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 609764ce5..0406644b4 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -76,9 +76,8 @@ void cmExtraCodeBlocksGenerator::Generate() void cmExtraCodeBlocksGenerator::CreateProjectFile( const std::vector& lgs) { - const cmMakefile* mf=lgs[0]->GetMakefile(); - std::string outputDir=mf->GetCurrentBinaryDirectory(); - std::string projectName=mf->GetProjectName(); + std::string outputDir=lgs[0]->GetCurrentBinaryDirectory(); + std::string projectName=lgs[0]->GetProjectName(); std::string filename=outputDir+"/"; filename+=projectName+".cbp"; @@ -273,7 +272,7 @@ void cmExtraCodeBlocksGenerator } const std::string &relative = cmSystemTools::RelativePath( - it->second[0]->GetMakefile()->GetHomeDirectory(), + it->second[0]->GetSourceDirectory(), jt->c_str()); std::vector splitted; cmSystemTools::SplitPath(relative, splitted, false); @@ -297,7 +296,7 @@ void cmExtraCodeBlocksGenerator tree.BuildVirtualFolder(virtualFolders); // And one for std::string unitFiles; - tree.BuildUnit(unitFiles, std::string(mf->GetHomeDirectory()) + "/"); + tree.BuildUnit(unitFiles, std::string(lgs[0]->GetSourceDirectory()) + "/"); // figure out the compiler std::string compiler = this->GetCBCompilerId(mf); @@ -307,7 +306,7 @@ void cmExtraCodeBlocksGenerator "\n" " \n" " \n" - "