diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2020-11-30 06:16:55 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-30 06:16:55 +1000 |
commit | f6ed6debbdbadf1763a932c00e5df0dfea48dd52 (patch) | |
tree | 5151c3503e761bbc9dc994a78a84e051210b51d4 | |
parent | 6df0de9aec76156774142138f76dfcb13d1451ec (diff) | |
parent | 86bed35a5a298901a6d8ad9f7b7e51d2393dbcfc (diff) |
Merge pull request #18877 from fuzzard/xcode_dmgfix
[OSX][packaging] allow ability create dmg from xcode generated project
-rw-r--r-- | cmake/scripts/osx/Install.cmake | 1 | ||||
-rwxr-xr-x | tools/darwin/packaging/osx/mkdmg-osx.sh.in | 36 |
2 files changed, 25 insertions, 12 deletions
diff --git a/cmake/scripts/osx/Install.cmake b/cmake/scripts/osx/Install.cmake index 629bc09cd3..2ae41f5b17 100644 --- a/cmake/scripts/osx/Install.cmake +++ b/cmake/scripts/osx/Install.cmake @@ -52,6 +52,7 @@ add_custom_target(dmg "DEV_TEAM=${DEV_TEAM}" "EXPANDED_CODE_SIGN_IDENTITY_NAME=${CODE_SIGN_IDENTITY}" "PLATFORM_NAME=${PLATFORM}" + "XCODE_BUILDTYPE=${CMAKE_CFG_INTDIR}" ./mkdmg-osx.sh ${CORE_BUILD_CONFIG_LOWERCASED} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx) set_target_properties(dmg PROPERTIES FOLDER "Build Utilities") diff --git a/tools/darwin/packaging/osx/mkdmg-osx.sh.in b/tools/darwin/packaging/osx/mkdmg-osx.sh.in index ac200a4c44..14456f78f1 100755 --- a/tools/darwin/packaging/osx/mkdmg-osx.sh.in +++ b/tools/darwin/packaging/osx/mkdmg-osx.sh.in @@ -2,20 +2,32 @@ # usage: ./mkdmg-osx.sh release/debug (case insensitive) # Allows us to run mkdmg-osx.sh from anywhere in the three, rather than the tools/darwin/packaging/osx folder only -SWITCH="$1" + +case "$XCODE_BUILDTYPE" in + ".") SWITCH="$1" ;; + *) SWITCH="$XCODE_BUILDTYPE" ;; +esac + DIRNAME=`dirname $0` -if [ ${SWITCH:-""} = "debug" ]; then - echo "Packaging Debug target for OSX" - APP="$DIRNAME/../../../../build/Debug/@APP_NAME@.app" -elif [ ${SWITCH:-""} = "release" ]; then - echo "Packaging Release target for OSX" - APP="$DIRNAME/../../../../build/Release/@APP_NAME@.app" - isReleaseBuild=1 -else - echo "You need to specify the build target" - exit 1 -fi +# use for case insensitive match. revert to system default after this block +shopt -s nocasematch +case "$SWITCH" in + "debug" ) + echo "Packaging Debug target for OSX" + APP="$DIRNAME/../../../../build/Debug/@APP_NAME@.app" + ;; + "release" ) + echo "Packaging Release target for OSX" + APP="$DIRNAME/../../../../build/Release/@APP_NAME@.app" + isReleaseBuild=1 + ;; + *) + echo "You need to specify the build target" + exit 1 + ;; +esac +shopt -u nocasematch if [ ! -d $APP ]; then echo "@APP_NAME@.app not found! are you sure you built $1 target?" |