diff options
author | Brad King <brad.king@kitware.com> | 2017-10-16 13:46:32 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-10-16 13:47:34 (GMT) |
commit | 42461a2a01e314dffe8841bef329d44d180e0044 (patch) | |
tree | aabc7291d970433ed83c4536a77ff0ff7d2a1f22 | |
parent | 9c3bdbd584bf449ccc80565185839ccd7ab939a5 (diff) | |
parent | 1943dc6bd5820424352db08dd2d65fb5a3cb2ef6 (diff) | |
download | CMake-42461a2a01e314dffe8841bef329d44d180e0044.zip CMake-42461a2a01e314dffe8841bef329d44d180e0044.tar.gz CMake-42461a2a01e314dffe8841bef329d44d180e0044.tar.bz2 |
Merge topic 'cpack-dmg-errors'
1943dc6b cmCPackDragNDropGenerator: Improve error reporting
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1379
-rw-r--r-- | Source/CPack/cmCPackDragNDropGenerator.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 1e1543f..bb35623 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -411,6 +411,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::string temp_image = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); temp_image += "/temp.dmg"; + std::string create_error; std::ostringstream temp_image_command; temp_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); temp_image_command << " create"; @@ -421,9 +422,11 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, temp_image_command << " -format " << temp_image_format; temp_image_command << " \"" << temp_image << "\""; - if (!this->RunCommand(temp_image_command)) { + if (!this->RunCommand(temp_image_command, &create_error)) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error generating temporary disk image." << std::endl); + "Error generating temporary disk image." << std::endl + << create_error + << std::endl); return 0; } @@ -464,15 +467,17 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Optionally set the custom icon flag for the image ... if (!had_error && !cpack_package_icon.empty()) { + std::string error; std::ostringstream setfile_command; setfile_command << this->GetOption("CPACK_COMMAND_SETFILE"); setfile_command << " -a C"; setfile_command << " \"" << temp_mount << "\""; - if (!this->RunCommand(setfile_command)) { + if (!this->RunCommand(setfile_command, &error)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Error assigning custom icon to temporary disk image." - << std::endl); + << std::endl + << error << std::endl); had_error = true; } @@ -717,9 +722,12 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, final_image_command << " zlib-level=9"; final_image_command << " -o \"" << output_file << "\""; - if (!this->RunCommand(final_image_command)) { + std::string convert_error; + + if (!this->RunCommand(final_image_command, &convert_error)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Error compressing disk image." - << std::endl); + << std::endl + << convert_error << std::endl); return 0; } |