summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorTim Hutt <tim.hutt@ultrahaptics.com>2017-02-14 10:09:23 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-17 16:47:00 (GMT)
commit734581f49fc0eac4c49e941c0cc450a04c866896 (patch)
tree0d4c398a3b1929933638411adcb88a23ce94b701 /Source/CPack
parent11e9605179e340833d95115fb0178d2ee84b3e24 (diff)
downloadCMake-734581f49fc0eac4c49e941c0cc450a04c866896.zip
CMake-734581f49fc0eac4c49e941c0cc450a04c866896.tar.gz
CMake-734581f49fc0eac4c49e941c0cc450a04c866896.tar.bz2
CPack: Add support for CPACK_PRODUCTBULID_RESOURCES_DIR
This allows you to copy custom files (e.g. a background image) into the macOS installer. Fixes: #16604
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackProductBuildGenerator.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx
index a5a18dc..0e93234 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.cxx
+++ b/Source/CPack/cmCPackProductBuildGenerator.cxx
@@ -59,12 +59,25 @@ int cmCPackProductBuildGenerator::PackageFiles()
}
}
- // Copy or create all of the resource files we need.
std::string resDir = packageDirFileName + "/Contents";
+
+ if (this->IsSet("CPACK_PRODUCTBUILD_RESOURCES_DIR")) {
+ std::string userResDir =
+ this->GetOption("CPACK_PRODUCTBUILD_RESOURCES_DIR");
+
+ if (!cmSystemTools::CopyADirectory(userResDir, resDir)) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files"
+ << std::endl);
+ return 0;
+ }
+ }
+
+ // Copy or create all of the resource files we need.
if (!this->CopyCreateResourceFile("License", resDir) ||
!this->CopyCreateResourceFile("ReadMe", resDir) ||
!this->CopyCreateResourceFile("Welcome", resDir)) {
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files"
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Problem copying the License, ReadMe and Welcome files"
<< std::endl);
return 0;
}