summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 55c7cb9..ef0197a 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1137,6 +1137,20 @@ void cmFindPackageCommand::AppendSuccessInformation()
}
}
+ // set a global property to record the required version of this package
+ std::string versionInfoPropName = "_CMAKE_";
+ versionInfoPropName += this->Name;
+ versionInfoPropName += "_REQUIRED_VERSION";
+ std::string versionInfo;
+ if(!this->Version.empty())
+ {
+ versionInfo = this->VersionExact ? "==" : ">=";
+ versionInfo += " ";
+ versionInfo += this->Version;
+ }
+ this->Makefile->GetCMakeInstance()->SetProperty(versionInfoPropName.c_str(),
+ versionInfo.c_str());
+
// Restore original state of "_FIND_" variables we set.
this->RestoreFindDefinitions();
}