chore: update the file

This commit is contained in:
x-tools-author 2025-03-03 17:40:41 +08:00
parent 8d8ddd9970
commit 58f4d806c1
3 changed files with 19 additions and 8 deletions

View File

@ -1,11 +1,11 @@
name: build-macos
on:
schedule:
- cron: '0 0 * * *'
# on:
# push:
# branches:
# - master
# schedule:
# - cron: '0 0 * * *'
on:
push:
branches:
- master
jobs:
build:
name: Build
@ -38,4 +38,5 @@ jobs:
cd build
cmake -DCMAKE_PREFIX_PATH='${{ github.workspace }}/Qt/${{ matrix.version }}/${{ matrix.arch }}' -DCMAKE_BUILD_TYPE=Release ../
cmake --build . --target all
ls ../bin
cmake --build . --target xTools_dmg

View File

@ -350,7 +350,7 @@ endif()
# --------------------------------------------------------------------------------------------------
# Make dmg for macOS
if(MACROS)
if(APPLE)
include(${CMAKE_SOURCE_DIR}/cmake/dmg/dmg.cmake)
x_tools_generate_dmg(xTools ${X_TOOLS_LATEST_GIT_TAG})
endif()

View File

@ -1,6 +1,16 @@
function(x_tools_generate_dmg target version)
if(NOT MACROS)
if(NOT APPLE)
return()
endif()
if(NOT MACDEPLOYQT_EXECUTABLE)
return()
endif()
add_custom_target(
${target}_dmg
COMMAND ${MACDEPLOYQT_EXECUTABLE} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target}.app" "-dmg"
COMMENT "Running macdeployqt..."
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endfunction()