summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-14 14:21:59 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-11-14 14:22:13 (GMT)
commitf22ecbacb6824881e755b19f498607793e19969c (patch)
tree5dfbeca647aac3bea51e5152d81ee3aa461bd81b /Source/cmMakefile.cxx
parent9b36209698819ec9f57c399d00c7a93105430cf2 (diff)
parent0ad8fc5a63835e477b4d70b44ac34fab4aeb96dc (diff)
downloadCMake-f22ecbacb6824881e755b19f498607793e19969c.zip
CMake-f22ecbacb6824881e755b19f498607793e19969c.tar.gz
CMake-f22ecbacb6824881e755b19f498607793e19969c.tar.bz2
Merge topic 'export-find_dependency-calls'
0ad8fc5a63 FetchContent: Set CMAKE_EXPORT_FIND_PACKAGE_NAME c6e6861e63 install(EXPORT): Export find_dependency() calls 2837f592ab cmExportFileGenerator: Add function to set required CMake version e62a3b8625 Help/export: Add signature directives Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Brad King <brad.king@kitware.com> Acked-by: Jason Juang <jasjuang@gmail.com> Merge-request: !8957
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx35
1 files changed, 35 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9ed422d..e055a34 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -302,6 +302,11 @@ cmListFileBacktrace cmMakefile::GetBacktrace() const
return this->Backtrace;
}
+cmFindPackageStack cmMakefile::GetFindPackageStack() const
+{
+ return this->FindPackageStack;
+}
+
void cmMakefile::PrintCommandTrace(cmListFileFunction const& lff,
cmListFileBacktrace const& bt,
CommandMissingFromStack missing) const
@@ -4771,6 +4776,36 @@ cmMakefile::MacroPushPop::~MacroPushPop()
this->Makefile->PopMacroScope(this->ReportError);
}
+cmMakefile::FindPackageStackRAII::FindPackageStackRAII(cmMakefile* mf,
+ std::string const& name)
+ : Makefile(mf)
+{
+ this->Makefile->FindPackageStack =
+ this->Makefile->FindPackageStack.Push(cmFindPackageCall{
+ name,
+ this->Makefile->FindPackageStackNextIndex,
+ });
+ this->Makefile->FindPackageStackNextIndex++;
+}
+
+cmMakefile::FindPackageStackRAII::~FindPackageStackRAII()
+{
+ this->Makefile->FindPackageStackNextIndex =
+ this->Makefile->FindPackageStack.Top().Index + 1;
+ this->Makefile->FindPackageStack = this->Makefile->FindPackageStack.Pop();
+
+ if (!this->Makefile->FindPackageStack.Empty()) {
+ auto top = this->Makefile->FindPackageStack.Top();
+ this->Makefile->FindPackageStack = this->Makefile->FindPackageStack.Pop();
+
+ top.Index = this->Makefile->FindPackageStackNextIndex;
+ this->Makefile->FindPackageStackNextIndex++;
+
+ this->Makefile->FindPackageStack =
+ this->Makefile->FindPackageStack.Push(top);
+ }
+}
+
cmMakefile::DebugFindPkgRAII::DebugFindPkgRAII(cmMakefile* mf,
std::string const& pkg)
: Makefile(mf)