diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2023-11-07 16:44:00 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2023-11-13 16:07:52 (GMT) |
commit | c6e6861e631ecfdc96c79f562a66021cb8971fcc (patch) | |
tree | 6cb0de03a6db5d0f997f5d351ac2a03bb060bff7 /Source/cmMakefile.cxx | |
parent | 2837f592ab7642e6a769949b4ddc1ffb37e21b9c (diff) | |
download | CMake-c6e6861e631ecfdc96c79f562a66021cb8971fcc.zip CMake-c6e6861e631ecfdc96c79f562a66021cb8971fcc.tar.gz CMake-c6e6861e631ecfdc96c79f562a66021cb8971fcc.tar.bz2 |
install(EXPORT): Export find_dependency() calls
Issue: #20511
Co-Authored-by: Brad King <brad.king@kitware.com>
Co-Authored-by: Robert Maynard <rmaynard@nvidia.com>
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 35 |
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) |