Qt: Replace macdeployqt with tools/deploy-mac.py

This commit is contained in:
Jeffrey Pfau 2014-12-27 18:17:47 -08:00
parent 66a1af39be
commit 27eb75fcde
1 changed files with 12 additions and 5 deletions

View File

@ -97,9 +97,16 @@ install(TARGETS ${BINARY_NAME}-qt
if(APPLE OR WIN32)
set_target_properties(${BINARY_NAME}-qt PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
endif()
if(APPLE AND MACDEPLOYQT)
add_custom_command(TARGET ${BINARY_NAME}-qt POST_BUILD COMMAND ${MACDEPLOYQT} ${PROJECT_NAME}.app)
add_custom_command(TARGET ${BINARY_NAME}-qt POST_BUILD COMMAND rm -r ${PROJECT_NAME}.app/Contents/Plugins/bearer)
add_custom_command(TARGET ${BINARY_NAME}-qt POST_BUILD COMMAND rm -r ${PROJECT_NAME}.app/Contents/Plugins/imageformats)
add_custom_command(TARGET ${BINARY_NAME}-qt POST_BUILD COMMAND rm -r ${PROJECT_NAME}.app/Contents/Plugins/printsupport)
if(APPLE)
set(DEPLOY_OPTIONS -p platforms/libqcocoa.dylib,accessible/libqtaccessiblewidgets.dylib,audio/libqtaudio_coreaudio.dylib)
if(NOT CMAKE_INSTALL_NAME_TOOL EQUAL "install_name_tool")
set(DEPLOY_OPTIONS ${DEPLOY_OPTIONS} -I ${CMAKE_INSTALL_NAME_TOOL})
endif()
if(DEFINED CMAKE_OTOOL AND NOT CMAKE_OTOOL EQUAL "otool")
set(DEPLOY_OPTIONS ${DEPLOY_OPTIONS} -O ${CMAKE_OTOOL})
endif()
if(DEFINED CROSS_ROOT)
set(DEPLOY_OPTIONS ${DEPLOY_OPTIONS} -R ${CROSS_ROOT})
endif()
add_custom_command(TARGET ${BINARY_NAME}-qt POST_BUILD COMMAND ${CMAKE_SOURCE_DIR}/tools/deploy-mac.py ${DEPLOY_OPTIONS} ${PROJECT_NAME}.app)
endif()