ENH: Add cmake_policy push/version/pop to import/export files.

This commit is contained in:
Brad King 2008-03-13 17:04:32 -04:00
parent ed795d283f
commit a0ef989715
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}