diff options
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r-- | Source/cmMakefile.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index f425697..6d44e79 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -787,6 +787,7 @@ public: cmValue GetProperty(const std::string& prop, bool chain) const; bool GetPropertyAsBool(const std::string& prop) const; std::vector<std::string> GetPropertyKeys() const; + void CheckProperty(const std::string& prop) const; //! Initialize a makefile from its parent void InitializeFromParent(cmMakefile* parent); @@ -859,6 +860,44 @@ public: void PushLoopBlockBarrier(); void PopLoopBlockBarrier(); + bool IsImportedTargetGlobalScope() const; + + enum class ImportedTargetScope + { + Local, + Global, + }; + + /** Helper class to manage whether imported packages + * should be globally scoped based off the find package command + */ + class SetGlobalTargetImportScope + { + public: + SetGlobalTargetImportScope(cmMakefile* mk, ImportedTargetScope const scope) + : Makefile(mk) + { + if (scope == ImportedTargetScope::Global && + !this->Makefile->IsImportedTargetGlobalScope()) { + this->Makefile->CurrentImportedTargetScope = scope; + this->Set = true; + } else { + this->Set = false; + } + } + ~SetGlobalTargetImportScope() + { + if (this->Set) { + this->Makefile->CurrentImportedTargetScope = + ImportedTargetScope::Local; + } + } + + private: + cmMakefile* Makefile; + bool Set; + }; + /** Helper class to push and pop scopes automatically. */ class ScopePushPop { @@ -1123,4 +1162,5 @@ private: std::set<std::string> WarnedCMP0074; bool IsSourceFileTryCompile; mutable bool SuppressSideEffects; + ImportedTargetScope CurrentImportedTargetScope = ImportedTargetScope::Local; }; |