diff options
author | Brad King <brad.king@kitware.com> | 2017-02-20 15:43:02 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2017-02-20 15:43:02 (GMT) |
commit | 5d17b68c675e0d05cd45835f366c62119ec7d7c8 (patch) | |
tree | 4242efb4461933e2e61063f5f402ab4b8f2bb89b /Source/CPack | |
parent | 168420f35cbcbd1ef0b2d24f3b254064e21c018e (diff) | |
parent | 734581f49fc0eac4c49e941c0cc450a04c866896 (diff) | |
download | CMake-5d17b68c675e0d05cd45835f366c62119ec7d7c8.zip CMake-5d17b68c675e0d05cd45835f366c62119ec7d7c8.tar.gz CMake-5d17b68c675e0d05cd45835f366c62119ec7d7c8.tar.bz2 |
Merge topic 'productbuild_resources'
734581f4 CPack: Add support for CPACK_PRODUCTBULID_RESOURCES_DIR
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/cmCPackProductBuildGenerator.cxx | 17 |
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; } |