summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-12-09 15:08:54 (GMT)
committerBrad King <brad.king@kitware.com>2008-12-09 15:08:54 (GMT)
commitae28ec9f243e2fd6a6d4462e890249cd43dd318a (patch)
treef2af70f4424e46ccbb9154fff5df7bd3a1dba5de /Source/cmFindPackageCommand.h
parent360d9465a20507d4acdc59f66eb7cb3694b43dc5 (diff)
downloadCMake-ae28ec9f243e2fd6a6d4462e890249cd43dd318a.zip
CMake-ae28ec9f243e2fd6a6d4462e890249cd43dd318a.tar.gz
CMake-ae28ec9f243e2fd6a6d4462e890249cd43dd318a.tar.bz2
ENH: Preserve <pkg>_FIND_XXX vars in find_package
When the find_package command loads a module it sets several <pkg>_FIND_XXX variables to communicate information about the command invocation to the module. This restores the original state of the variables when the command returns. This behavior is useful when a find-module recursively calls find_package with NO_MODULE so that the inner call does not change the values in the find-module.
Diffstat (limited to 'Source/cmFindPackageCommand.h')
-rw-r--r--Source/cmFindPackageCommand.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index cf7b93c..1bfb2af 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -75,6 +75,8 @@ private:
void AppendToProperty(const char* propertyName);
void SetModuleVariables(const std::string& components);
bool FindModule(bool& found);
+ void AddFindDefinition(const char* var, const char* val);
+ void RestoreFindDefinitions();
bool HandlePackageMode();
void FindConfig();
bool FindPrefixedConfig();
@@ -104,6 +106,9 @@ private:
friend class cmFindPackageFileList;
+ struct OriginalDef { bool exists; std::string value; };
+ std::map<cmStdString, OriginalDef> OriginalDefs;
+
std::string CommandDocumentation;
cmStdString Name;
cmStdString Variable;