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/${PNG_LIBNAME} ${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 cp -pPR ${SDL2_IMAGE_LIBRARIES} ${frameworks_dir}) |
|
29 execute_process(COMMAND cp -pPR ${SDL2_NET_LIBRARIES} ${frameworks_dir}) |
|
30 execute_process(COMMAND cp -pPR ${SDL2_TTF_LIBRARIES} ${frameworks_dir}) |
|
31 execute_process(COMMAND cp -pPR ${SDL2_MIXER_LIBRARIES} ${frameworks_dir}) |
|
32 execute_process(COMMAND cp -pPR ${OGG_LIBRARY} ${frameworks_dir}) |
|
33 execute_process(COMMAND cp -pPR ${VORBIS_LIBRARY} ${frameworks_dir}) |
|
34 |
|
35 if(${SPARKLE_FOUND}) |
16 if(${SPARKLE_FOUND}) |
36 execute_process(COMMAND cp -pPR ${SPARKLE_LIBRARY} ${frameworks_dir}) |
17 execute_process(COMMAND cp -pPR ${SPARKLE_LIBRARY} ${frameworks_dir}) |
37 endif() |
18 endif() |
38 message(STATUS "Frameworks and libraries successfully copied...") |
19 message(STATUS "Frameworks and libraries successfully copied...") |
39 else() |
20 else() |