tools/CreateMacBundle.cmake.in
branch0.9.23
changeset 12893 41d147eb26ea
parent 12892 62f7d28e93e3
equal deleted inserted replaced
12892:62f7d28e93e3 12893:41d147eb26ea
     3 # prepare Frameworks directory
     3 # prepare Frameworks directory
     4 execute_process(COMMAND mkdir -p ${frameworks_dir})
     4 execute_process(COMMAND mkdir -p ${frameworks_dir})
     5 # macdeployqt will convert safely any absolute path library for 'hedgewars'
     5 # macdeployqt will convert safely any absolute path library for 'hedgewars'
     6 execute_process(COMMAND ${macdeployqt_executable} ${CMAKE_BINARY_DIR}/Hedgewars.app OUTPUT_QUIET ERROR_QUIET)
     6 execute_process(COMMAND ${macdeployqt_executable} ${CMAKE_BINARY_DIR}/Hedgewars.app OUTPUT_QUIET ERROR_QUIET)
     7 
     7 
       
     8 # but macdeployqt will not work for a second executable, so employ this series of ridiculous commands to work around it
       
     9 execute_process(COMMAND mv ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hedgewars ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/tmp)
       
    10 execute_process(COMMAND mv ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hwengine ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hedgewars)
       
    11 execute_process(COMMAND ${macdeployqt_executable} ${CMAKE_BINARY_DIR}/Hedgewars.app OUTPUT_QUIET ERROR_QUIET)
       
    12 execute_process(COMMAND mv ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hedgewars ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hwengine)
       
    13 execute_process(COMMAND mv ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/tmp ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hedgewars)
       
    14 
     8 if(doBundle EQUAL 1)
    15 if(doBundle EQUAL 1)
     9     if(NOT ${NOVIDEOREC})
       
    10         # but macdeployqt will not work for 'hwengine'
       
    11         # luckily most the dylibs are already updated before
       
    12         execute_process(COMMAND install_name_tool -change ${LIBAVCODEC_LIBRARY} @executable_path/../Frameworks/libavcodec.dylib ${engine_full_path})
       
    13         execute_process(COMMAND install_name_tool -change ${LIBAVFORMAT_LIBRARY} @executable_path/../Frameworks/libavformat.dylib ${engine_full_path})
       
    14         execute_process(COMMAND install_name_tool -change ${LIBAVUTIL_LIBRARY} @executable_path/../Frameworks/libavutil.dylib ${engine_full_path})
       
    15     endif()
       
    16 
       
    17     if(NOT ${NOPNG})
       
    18         # same here, for libpng and hwengine, let's assume the version pulled
       
    19         # by macdeployqt matches (yes, libpng is pulled in by macdeployqt even
       
    20         # when NOVIDEOREC is ON)
       
    21         execute_process(COMMAND install_name_tool -change ${PNG_LIBRARY} @executable_path/../Frameworks/libpng16.16.dylib ${engine_full_path})
       
    22         #execute_process(COMMAND install_name_tool -change ${ZLIB_LIBRARY} @executable_path/../Frameworks/${ZLIB_LIBNAME} ${engine_full_path})
       
    23     endif()
       
    24 
       
    25     execute_process(COMMAND cp ${PNG_LIBRARY} ${frameworks_dir})
       
    26 
       
    27     execute_process(COMMAND cp -pPR ${sdl_library_only}  ${frameworks_dir})
       
    28     execute_process(COMMAND install_name_tool -change ${sdl_library_only} @executable_path/../Frameworks/libSDL2-2.0.0.dylib  ${engine_full_path})
       
    29     execute_process(COMMAND cp -pPR ${SDL2_IMAGE_LIBRARIES} ${frameworks_dir})
       
    30     execute_process(COMMAND install_name_tool -change ${SDL2_IMAGE_LIBRARIES} @executable_path/../Frameworks/libSDL2_image-2.0.0.dylib  ${engine_full_path})
       
    31     execute_process(COMMAND cp -pPR ${SDL2_NET_LIBRARIES}   ${frameworks_dir})
       
    32     execute_process(COMMAND install_name_tool -change ${SDL2_NET_LIBRARIES} @executable_path/../Frameworks/libSDL2_net-2.0.0.dylib  ${engine_full_path})
       
    33     execute_process(COMMAND cp -pPR ${SDL2_TTF_LIBRARIES}   ${frameworks_dir})
       
    34     execute_process(COMMAND install_name_tool -change ${SDL2_TTF_LIBRARIES} @executable_path/../Frameworks/libSDL2_ttf-2.0.0.dylib  ${engine_full_path})
       
    35     execute_process(COMMAND cp -pPR ${SDL2_MIXER_LIBRARIES} ${frameworks_dir})
       
    36     execute_process(COMMAND install_name_tool -change ${SDL2_MIXER_LIBRARIES} @executable_path/../Frameworks/libSDL2_mixer-2.0.0.dylib  ${engine_full_path})
       
    37 
       
    38     execute_process(COMMAND cp -pPR ${OGG_LIBRARY}       ${frameworks_dir})
       
    39     execute_process(COMMAND cp -pPR ${VORBIS_LIBRARY}    ${frameworks_dir})
       
    40 
       
    41     if(${SPARKLE_FOUND})
    16     if(${SPARKLE_FOUND})
    42         execute_process(COMMAND cp -pPR ${SPARKLE_LIBRARY} ${frameworks_dir})
    17         execute_process(COMMAND cp -pPR ${SPARKLE_LIBRARY} ${frameworks_dir})
    43     endif()
    18     endif()
    44     message(STATUS "Frameworks and libraries successfully copied...")
    19     message(STATUS "Frameworks and libraries successfully copied...")
    45 else()
    20 else()