tools/CreateMacBundle.cmake.in
changeset 11611 b53c3134d55a
parent 11609 b77870abb3c4
child 12386 e4f8bf43224d
equal deleted inserted replaced
11610:523b153f7f22 11611:b53c3134d55a
     1 
     1 # check for a well known-framework
     2 execute_process(COMMAND stat ${frameworks_dir}/SDL.framework RESULT_VARIABLE doBundle OUTPUT_QUIET ERROR_QUIET)
     2 execute_process(COMMAND stat ${frameworks_dir}/QtCore.framework RESULT_VARIABLE doBundle OUTPUT_QUIET ERROR_QUIET)
       
     3 # prepare Frameworks directory
     3 execute_process(COMMAND mkdir -p ${frameworks_dir})
     4 execute_process(COMMAND mkdir -p ${frameworks_dir})
     4 # macdeployqt will convert safely any absolute path library for 'hedgewars'
     5 # macdeployqt will convert safely any absolute path library for 'hedgewars'
     5 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)
     6 
     7 
     7 if(NOT ${NOVIDEOREC})
     8 if(doBundle EQUAL 1)
     8     # but macdeployqt will not work for 'hwengine'; luckily the dylibs were already updated before
     9     if(NOT ${NOVIDEOREC})
     9     execute_process(COMMAND install_name_tool -change ${LIBAVCODEC_LIBRARY} @executable_path/../Frameworks/libavcodec.dylib ${engine_full_path})
    10         # but macdeployqt will not work for 'hwengine'
    10     execute_process(COMMAND install_name_tool -change ${LIBAVFORMAT_LIBRARY} @executable_path/../Frameworks/libavformat.dylib ${engine_full_path})
    11         # luckily most the dylibs are already updated before
    11     execute_process(COMMAND install_name_tool -change ${LIBAVUTIL_LIBRARY} @executable_path/../Frameworks/libavutil.dylib ${engine_full_path})
    12         execute_process(COMMAND install_name_tool -change ${LIBAVCODEC_LIBRARY} @executable_path/../Frameworks/libavcodec.dylib ${engine_full_path})
    12 endif()
    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()
    13 
    16 
    14 if(NOT ${NOPNG})
    17     if(NOT ${NOPNG})
    15     #same here, for libpng and hwengine, let's assume the version pulled by macdeployqt is the same
    18         # same here, for libpng and hwengine, let's assume the version pulled
    16     #(yes libpng is pulled by macdeployqt even when NOVIDEOREC is active)
    19         # by macdeployqt matches (yes, libpng is pulled in by macdeployqt even
    17     execute_process(COMMAND install_name_tool -change ${PNG_LIBRARY} @executable_path/../Frameworks/${PNG_LIBNAME} ${engine_full_path})
    20         # when NOVIDEOREC is ON)
    18     execute_process(COMMAND install_name_tool -change ${ZLIB_LIBRARY} @executable_path/../Frameworks/${ZLIB_LIBNAME} ${engine_full_path})
    21         execute_process(COMMAND install_name_tool -change ${PNG_LIBRARY} @executable_path/../Frameworks/${PNG_LIBNAME} ${engine_full_path})
    19 endif()
    22         execute_process(COMMAND install_name_tool -change ${ZLIB_LIBRARY} @executable_path/../Frameworks/${ZLIB_LIBNAME} ${engine_full_path})
       
    23     endif()
    20 
    24 
    21 if(doBundle EQUAL 1)
       
    22     execute_process(COMMAND cp ${PNG_LIBRARY} ${frameworks_dir})
    25     execute_process(COMMAND cp ${PNG_LIBRARY} ${frameworks_dir})
    23 
    26 
    24     execute_process(COMMAND cp -pPR ${sdl_library_only}  ${frameworks_dir})
    27     execute_process(COMMAND cp -pPR ${sdl_library_only}  ${frameworks_dir})
    25     execute_process(COMMAND cp -pPR ${SDL2IMAGE_LIBRARY} ${frameworks_dir})
    28     execute_process(COMMAND cp -pPR ${SDL2IMAGE_LIBRARY} ${frameworks_dir})
    26     execute_process(COMMAND cp -pPR ${SDL2NET_LIBRARY}   ${frameworks_dir})
    29     execute_process(COMMAND cp -pPR ${SDL2NET_LIBRARY}   ${frameworks_dir})