summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-12-11 14:00:14 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-12-11 14:00:19 (GMT)
commit9720c142559ad8b48326de1fb636ae66e1f74184 (patch)
tree8090b8101215792d6dd30e0b241c4e367a0372b7 /Source
parent0f57e1515770d146de3294770aa63b8d727eabe6 (diff)
parent93d5f464cc9cdf4a3b30565828ce23065ce51d01 (diff)
downloadCMake-9720c142559ad8b48326de1fb636ae66e1f74184.zip
CMake-9720c142559ad8b48326de1fb636ae66e1f74184.tar.gz
CMake-9720c142559ad8b48326de1fb636ae66e1f74184.tar.bz2
Merge topic 'cpack-generator-scripts-enable-all-cmake-policies'
93d5f464 CPack: enable all CMake policies for generator scripts Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1582
Diffstat (limited to 'Source')
-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*/