summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2017-03-25 20:01:59 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2017-12-09 11:50:28 (GMT)
commit93d5f464cc9cdf4a3b30565828ce23065ce51d01 (patch)
tree48033517d8bda79f0382ad1e6b4f81a948a1eda0 /Source/CPack
parent0fe1966b7994969c2220efbec51bf49c0406fac8 (diff)
downloadCMake-93d5f464cc9cdf4a3b30565828ce23065ce51d01.zip
CMake-93d5f464cc9cdf4a3b30565828ce23065ce51d01.tar.gz
CMake-93d5f464cc9cdf4a3b30565828ce23065ce51d01.tar.bz2
CPack: enable all CMake policies for generator scripts
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index be75a9f..ea0e899 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -17,6 +17,7 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmStateSnapshot.h"
+#include "cmVersion.h"
#include "cmWorkingDirectory.h"
#include "cmXMLSafe.h"
#include "cmake.h"
@@ -988,10 +989,16 @@ int cmCPackGenerator::DoPackage()
*/
packageFileNames.push_back(tempPackageFileName ? tempPackageFileName : "");
toplevel = tempDirectory;
- if (!this->PackageFiles() || cmSystemTools::GetErrorOccuredFlag()) {
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem compressing the directory"
- << std::endl);
- return 0;
+ { // scope that enables package generators to run internal scripts with
+ // latest CMake policies enabled
+ cmMakefile::ScopePushPop pp{ this->MakefileMap };
+ this->MakefileMap->SetPolicyVersion(cmVersion::GetCMakeVersion());
+
+ if (!this->PackageFiles() || cmSystemTools::GetErrorOccuredFlag()) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem compressing the directory"
+ << std::endl);
+ return 0;
+ }
}
/* Prepare checksum algorithm*/