diff --git a/CMakeLists.txt b/CMakeLists.txt index 331ce349f3..fed8fbd843 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2916,34 +2916,32 @@ if(ENABLE_APPLICATION_BUNDLE) ) add_dependencies(app_bundle ${PROGLIST} chmodbpf path_helper) - if( DMGBUILD_EXECUTABLE AND ASCIIDOCTOR_FOUND) - add_custom_target(dmg_package_prep DEPENDS app_bundle) + add_custom_target(dmg_package_prep DEPENDS app_bundle) - set(_read_me_first "packaging/macosx/Read me first.html") - ADD_CUSTOM_COMMAND( - OUTPUT - ${_read_me_first} - COMMAND ${ASCIIDOCTOR_EXECUTABLE} - --backend html - --out-file ${_read_me_first} - --attribute include-dir=${CMAKE_SOURCE_DIR}/docbook - --attribute min-macos-version=${MIN_MACOS_VERSION} - ${CMAKE_CURRENT_SOURCE_DIR}/packaging/macosx/Read_me_first.adoc - DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/packaging/macosx/Read_me_first.adoc - ) - add_custom_target(read_me_first_html DEPENDS ${_read_me_first} ) - add_dependencies(dmg_package_prep read_me_first_html) + set(_read_me_first "packaging/macosx/Read me first.html") + ADD_CUSTOM_COMMAND( + OUTPUT + ${_read_me_first} + COMMAND ${ASCIIDOCTOR_EXECUTABLE} + --backend html + --out-file ${_read_me_first} + --attribute include-dir=${CMAKE_SOURCE_DIR}/docbook + --attribute min-macos-version=${MIN_MACOS_VERSION} + ${CMAKE_CURRENT_SOURCE_DIR}/packaging/macosx/Read_me_first.adoc + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/packaging/macosx/Read_me_first.adoc + ) + add_custom_target(read_me_first_html DEPENDS ${_read_me_first} ) + add_dependencies(dmg_package_prep read_me_first_html) - ADD_CUSTOM_TARGET( dmg_package - COMMAND bash -x ${CMAKE_BINARY_DIR}/packaging/macosx/osx-dmg.sh - # Unlike nsis_package_prep + nsis_package, we can add a direct - # dependency here. - DEPENDS dmg_package_prep - # We create Wireshark.app in "run". Do our work there. - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/run - ) - endif() + ADD_CUSTOM_TARGET( dmg_package + COMMAND bash -x ${CMAKE_BINARY_DIR}/packaging/macosx/osx-dmg.sh + # Unlike nsis_package_prep + nsis_package, we can add a direct + # dependency here. + DEPENDS dmg_package_prep + # We create Wireshark.app in "run". Do our work there. + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/run + ) endif() diff --git a/packaging/macosx/osx-dmg.sh.in b/packaging/macosx/osx-dmg.sh.in index 9967d83953..3934a12f85 100755 --- a/packaging/macosx/osx-dmg.sh.in +++ b/packaging/macosx/osx-dmg.sh.in @@ -2,6 +2,8 @@ # # The script creates a disk image using the dmgbuild utility and signs it. +set -e + # Defaults dmgbuild="@DMGBUILD_EXECUTABLE@" version="@VERSION@" @@ -27,6 +29,11 @@ dmgbuild-settings.py.in. " } +if [ ! -x "$dmgbuild" ] ; then + echo "Error: \"$dmgbuild\" not found." + exit 1 +fi + # Parse command line arguments while [ "$1" != "" ] do