Qt: Rename project binaries for platforms excluding OS X and Windows

This commit is contained in:
Jeffrey Pfau 2014-12-06 19:25:57 -08:00
parent 9a61475229
commit 9299b75be5
1 changed files with 12 additions and 9 deletions

View File

@ -76,19 +76,22 @@ qt5_add_resources(RESOURCES resources.qrc)
if(WIN32) if(WIN32)
list(APPEND RESOURCES ${CMAKE_SOURCE_DIR}/res/mgba.rc) list(APPEND RESOURCES ${CMAKE_SOURCE_DIR}/res/mgba.rc)
endif() endif()
add_executable(mGBA WIN32 MACOSX_BUNDLE main.cpp ${CMAKE_SOURCE_DIR}/res/mgba.icns ${SOURCE_FILES} ${UI_FILES} ${RESOURCES}) add_executable(${BINARY_NAME}-qt WIN32 MACOSX_BUNDLE main.cpp ${CMAKE_SOURCE_DIR}/res/mgba.icns ${SOURCE_FILES} ${UI_FILES} ${RESOURCES})
set_target_properties(mGBA PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/res/info.plist.in) set_target_properties(${BINARY_NAME}-qt PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/res/info.plist.in)
set(QT_LIBRARIES Qt5::Widgets Qt5::OpenGL) set(QT_LIBRARIES Qt5::Widgets Qt5::OpenGL)
if(Qt5Multimedia_FOUND) if(Qt5Multimedia_FOUND)
list(APPEND QT_LIBRARIES Qt5::Multimedia) list(APPEND QT_LIBRARIES Qt5::Multimedia)
endif() endif()
target_link_libraries(mGBA ${PLATFORM_LIBRARY} ${OPENGL_LIBRARY} ${BINARY_NAME} ${QT_LIBRARIES}) target_link_libraries(${BINARY_NAME}-qt ${PLATFORM_LIBRARY} ${OPENGL_LIBRARY} ${BINARY_NAME} ${QT_LIBRARIES})
install(TARGETS mGBA RUNTIME DESTINATION bin BUNDLE DESTINATION /Applications) install(TARGETS ${BINARY_NAME}-qt RUNTIME DESTINATION bin BUNDLE DESTINATION /Applications)
if(APPLE AND MACDEPLOYQT) if(APPLE OR WIN32)
add_custom_command(TARGET mGBA POST_BUILD COMMAND ${MACDEPLOYQT} mGBA.app) set_target_properties(${BINARY_NAME}-qt PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
add_custom_command(TARGET mGBA POST_BUILD COMMAND rm -r mGBA.app/Contents/Plugins/bearer) endif()
add_custom_command(TARGET mGBA POST_BUILD COMMAND rm -r mGBA.app/Contents/Plugins/imageformats) if(APPLE AND MACDEPLOYQT)
add_custom_command(TARGET mGBA POST_BUILD COMMAND rm -r mGBA.app/Contents/Plugins/printsupport) 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)
endif() endif()