summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-03-13 21:04:32 (GMT)
committerBrad King <brad.king@kitware.com>2008-03-13 21:04:32 (GMT)
commita0ef9897159c2b64383ab1d3aa33fd43fec632d7 (patch)
tree1921429c8a95251233c2c333417f2a4e59f9230b /Source/cmExportFileGenerator.cxx
parented795d283f33699080b56255eadc6fb5b389968d (diff)
downloadCMake-a0ef9897159c2b64383ab1d3aa33fd43fec632d7.zip
CMake-a0ef9897159c2b64383ab1d3aa33fd43fec632d7.tar.gz
CMake-a0ef9897159c2b64383ab1d3aa33fd43fec632d7.tar.bz2
ENH: Add cmake_policy push/version/pop to import/export files.
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index f28f841..914b044 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -20,6 +20,7 @@
#include "cmMakefile.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
+#include "cmVersion.h"
#include <cmsys/auto_ptr.hxx>
@@ -79,6 +80,11 @@ bool cmExportFileGenerator::GenerateImportFile()
std::ostream& os = *foutPtr;
// Start with the import file header.
+ os << "CMAKE_POLICY(PUSH)\n"
+ << "CMAKE_POLICY(VERSION "
+ << cmVersion::GetMajorVersion() << "."
+ << cmVersion::GetMinorVersion() << "."
+ << cmVersion::GetPatchVersion() << ")\n";
this->GenerateImportHeaderCode(os);
// Create all the imported targets.
@@ -86,6 +92,7 @@ bool cmExportFileGenerator::GenerateImportFile()
// End with the import file footer.
this->GenerateImportFooterCode(os);
+ os << "CMAKE_POLICY(POP)\n";
return result;
}