tools/CMakeLists.txt
branchwebgl
changeset 9521 8054d9d775fd
parent 9347 5b582d49358c
child 9679 dfaa39674e1e
child 9961 c18c66d621e5
equal deleted inserted replaced
9282:92af50454cf2 9521:8054d9d775fd
    48     find_program(macdeployqt_executable NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin)
    48     find_program(macdeployqt_executable NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin)
    49     if(NOT macdeployqt_executable)
    49     if(NOT macdeployqt_executable)
    50         message(FATAL_ERROR "The utility macdeployqt is required to create the bundle (seached: ${qt_base_dir})")
    50         message(FATAL_ERROR "The utility macdeployqt is required to create the bundle (seached: ${qt_base_dir})")
    51     endif()
    51     endif()
    52 
    52 
    53     #dummy target, we're interested in the postscript file
    53     #create the .app bundle
    54     add_custom_target(bundle)
    54     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
    55     set_target_properties(bundle PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
    55     install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake
       
    56             CODE "message(STATUS \"Your app bundle is ready\")")
    56 
    57 
    57     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
    58     #create the .dmg for deployment
       
    59     #first make sure .app exists, then remove any old .dmg with same name, finally run the script
       
    60     add_custom_target(dmg COMMAND if [ ! -a Hedgewars.app ]; then make install\; fi;
       
    61                           COMMAND rm -f ${CMAKE_BINARY_DIR}/Hedgewars-${HEDGEWARS_VERSION}.dmg
       
    62                           COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/create-dmg.sh
       
    63                                   --volname "Hedgewars ${HEDGEWARS_VERSION}"
       
    64                                 # --volicon icon.icns
       
    65                                   --window-size 600 470
       
    66                                   --icon-size 96
       
    67                                   --icon "Hedgewars" 190 190
       
    68                                   --app-drop-link 410 190
       
    69                                   --background "${CMAKE_CURRENT_SOURCE_DIR}/../misc/dmgBackground.png"
       
    70                                   ${CMAKE_BINARY_DIR}/Hedgewars-${HEDGEWARS_VERSION}.dmg
       
    71                                   ${CMAKE_BINARY_DIR}/Hedgewars.app
       
    72                           WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
    58 endif()
    73 endif()
    59 
    74