| 4248 | } |
| 4249 | |
| 4250 | cmMakefile::FindPackageStackRAII::~FindPackageStackRAII() |
| 4251 | { |
| 4252 | this->Makefile->FindPackageStackNextIndex = |
| 4253 | this->Makefile->FindPackageStack.Top().Index + 1; |
| 4254 | this->Makefile->FindPackageStack = this->Makefile->FindPackageStack.Pop(); |
| 4255 | |
| 4256 | if (!this->Makefile->FindPackageStack.Empty()) { |
| 4257 | // We have just finished an inner package found as a dependency of an |
| 4258 | // outer package. Targets created in the outer package after this |
| 4259 | // point may depend on the inner package, so if they are exported, |
| 4260 | // their find_dependency call for the outer package should be |
| 4261 | // ordered after the find_dependency call for the inner package. |
| 4262 | // |
| 4263 | // Any targets created by the outer package before the inner package |
| 4264 | // was loaded will have already saved a copy of the outer package |
| 4265 | // stack with its original index. Replace the top entry with a new |
| 4266 | // one representing the same outer package with a new index. |
| 4267 | cmFindPackageCall outer = this->Makefile->FindPackageStack.Top(); |
| 4268 | this->Makefile->FindPackageStack = this->Makefile->FindPackageStack.Pop(); |
| 4269 | |
| 4270 | outer.Index = this->Makefile->FindPackageStackNextIndex; |
| 4271 | this->Makefile->FindPackageStackNextIndex++; |
| 4272 | |
| 4273 | this->Makefile->FindPackageStack = |
| 4274 | this->Makefile->FindPackageStack.Push(outer); |
| 4275 | } |
| 4276 | } |
| 4277 | |
| 4278 | cmMakefile::DebugFindPkgRAII::DebugFindPkgRAII(cmMakefile* mf, |
| 4279 | std::string const& pkg) |