ENH: Add cmake_policy push/version/pop to import/export files.
This commit is contained in:
parent
ed795d283f
commit
a0ef989715
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue