tools/CreateMacBundle.cmake.in
author Wuzzy <Wuzzy2@mail.ru>
Mon, 12 Mar 2018 19:39:00 +0100
changeset 13173 4d1cf0d76eb7
parent 12888 41d147eb26ea
permissions -rw-r--r--
Remove rubber duck from BRW, RW and most weapon schemes for now The duck is not liked by players. Rubber duck needs a lot of rework. Before that happens, better remove it from game modes for now. Players can always modify the weapon schemes, of course.

# check for a well known-framework
execute_process(COMMAND stat ${frameworks_dir}/QtCore.framework RESULT_VARIABLE doBundle OUTPUT_QUIET ERROR_QUIET)
# prepare Frameworks directory
execute_process(COMMAND mkdir -p ${frameworks_dir})
# macdeployqt will convert safely any absolute path library for 'hedgewars'
execute_process(COMMAND ${macdeployqt_executable} ${CMAKE_BINARY_DIR}/Hedgewars.app OUTPUT_QUIET ERROR_QUIET)

# but macdeployqt will not work for a second executable, so employ this series of ridiculous commands to work around it
execute_process(COMMAND mv ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hedgewars ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/tmp)
execute_process(COMMAND mv ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hwengine ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hedgewars)
execute_process(COMMAND ${macdeployqt_executable} ${CMAKE_BINARY_DIR}/Hedgewars.app OUTPUT_QUIET ERROR_QUIET)
execute_process(COMMAND mv ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hedgewars ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hwengine)
execute_process(COMMAND mv ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/tmp ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hedgewars)

if(doBundle EQUAL 1)
    if(${SPARKLE_FOUND})
        execute_process(COMMAND cp -pPR ${SPARKLE_LIBRARY} ${frameworks_dir})
    endif()
    message(STATUS "Frameworks and libraries successfully copied...")
else()
    message(STATUS "Frameworks already present, skipping...")
endif()