Ticket #51083: patch-build-app-bundle.diff

File patch-build-app-bundle.diff, 1.2 KB (added by RJVB (René Bertin), 9 years ago)
  • CMakeLists.txt

    diff --git CMakeLists.txt CMakeLists.txt
    index ddccd04..024d6df 100644
    SET(RESOURCE_FILES 
    8484# in result SAMPLE_RC_SRCS variable will contain paths to files produced by rcc
    8585QT5_ADD_RESOURCES(RC_SRCS ${RESOURCE_FILES})
    8686
    87 
    88 add_executable(qgit ${CPP_SOURCES} ${UIS_HDRS} ${RC_SRCS})
     87if(APPLE)
     88    set(MACOSX_BUNDLE_ICON_FILE qgit.icns)
     89    set(ICON ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/qgit.icns)
     90    set_source_files_properties(${ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
     91    add_executable(qgit MACOSX_BUNDLE ${CPP_SOURCES} ${UIS_HDRS} ${RC_SRCS} ${ICON})
     92    set_target_properties(qgit PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE)
     93    set_target_properties(qgit PROPERTIES MACOSX_BUNDLE_ICON_FILE qgit.icns )
     94    set_target_properties(qgit PROPERTIES MACOSX_BUNDLE_LONG_VERSION_STRING @VERSION@ )
     95    set_target_properties(qgit PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING @VERSION@ )
     96    set_target_properties(qgit PROPERTIES MACOSX_BUNDLE_BUNDLE_VERSION @VERSION@ )
     97elseif()
     98    add_executable(qgit ${CPP_SOURCES} ${UIS_HDRS} ${RC_SRCS})
     99endif()
    89100
    90101# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
    91102target_link_libraries(qgit ${Qt5Widgets_LIBRARIES})