diff options
author | David Cole <david.cole@kitware.com> | 2009-01-22 18:56:13 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2009-01-22 18:56:13 (GMT) |
commit | 6bf31875ce3a87078ba3e90ce2e8cde44d561d86 (patch) | |
tree | 8be2d7b83f49f1028ddebea3d7197cffe8c990a2 /Source/CPack/cmCPackBundleGenerator.cxx | |
parent | c332e0bf3c4e619358322bd0d0961af45653eb5b (diff) | |
download | CMake-6bf31875ce3a87078ba3e90ce2e8cde44d561d86.zip CMake-6bf31875ce3a87078ba3e90ce2e8cde44d561d86.tar.gz CMake-6bf31875ce3a87078ba3e90ce2e8cde44d561d86.tar.bz2 |
BUG: Fix issue #8383. Avoid crashing when using the Bundle CPack generator and CPACK_BUNDLE_NAME is not set. Instead, fail gracefully giving an informative error message and non-zero exit code.
Diffstat (limited to 'Source/CPack/cmCPackBundleGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackBundleGenerator.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index d564308..62183e6 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -32,6 +32,22 @@ cmCPackBundleGenerator::~cmCPackBundleGenerator() } //---------------------------------------------------------------------- +int cmCPackBundleGenerator::InitializeInternal() +{ + const char* name = this->GetOption("CPACK_BUNDLE_NAME"); + if(0 == name) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPACK_BUNDLE_NAME must be set to use the Bundle generator." + << std::endl); + + return 0; + } + + return this->Superclass::InitializeInternal(); +} + +//---------------------------------------------------------------------- const char* cmCPackBundleGenerator::GetPackagingInstallPrefix() { this->InstallPrefix = "/"; |