summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2010-08-24 19:24:54 (GMT)
committerAlex Neundorf <neundorf@kde.org>2010-08-24 19:24:54 (GMT)
commit33338781db35e5f86d2d11ae3b48be57a9d5e376 (patch)
tree0fcfb034fe67cdb9664e2b9615e7a4590c60de57 /Source/cmFindPackageCommand.cxx
parentd5e3e04a23e270de97c8614aaca9663d64c42942 (diff)
downloadCMake-33338781db35e5f86d2d11ae3b48be57a9d5e376.zip
CMake-33338781db35e5f86d2d11ae3b48be57a9d5e376.tar.gz
CMake-33338781db35e5f86d2d11ae3b48be57a9d5e376.tar.bz2
Log the required package version and major improvement to FeatureSummary
find_package() now also stores the required version automatically, so it can be used by FeatureSummary.cmake. This was one of the requested features for setting up nightly builds for KDE, since with this functionality it will be possible to write a file at the end of each project which lists all required packages and their versions. This file could then be compared for equality with an older one and if something has changed the build maintainer can be emailed. In FeatureSummary.cmake there is now a new function feature_summary(), which also allows to print the log to a file or into a variable. It also allows to specify whether to append to a file or to write a new one, and what information to log. Docs are still missing. Alex
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 eb86014..5c05ecb 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1083,6 +1083,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();
}