chore: update the file

This commit is contained in:
x-tools-author 2025-03-04 10:59:45 +08:00
parent b53e906359
commit 4baa098fa9
2 changed files with 4 additions and 10 deletions

View File

@ -7,13 +7,10 @@ function(x_tools_generate_dmg target version)
return()
endif()
set(old_name ${target}.dmg)
set(new_name ${X_ASSET_NAME}.dmg)
add_custom_target(
${target}_dmg
COMMAND ${MACDEPLOYQT_EXECUTABLE} "${target}.app" "-dmg"
COMMAND ${CMAKE_COMMAND} -E rename "${old_name}" "${new_name}"
COMMAND ${CMAKE_COMMAND} -E rename "${target}.dmg" "${X_ASSET_NAME}.dmg"
COMMENT "Making dmg..."
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endfunction()

View File

@ -68,14 +68,11 @@ else()
usr/share/applications/${argPacketName}.desktop -always-overwrite
-bundle-non-qt-libs -qmake=${argQmakePath} -appimage
WORKING_DIRECTORY ${argWorkingDir})
# Find all AppImage in ${argWorkingDir} and rename it with lower case, such as "xTools-x86_64.AppImage" -> "xtools-x86_64.AppImage"
# Take care: the suffix is AppImage, not appimage. the insert "linux-" after the first '-', such as "xtools-x86_64.AppImage" -> "xtools-linux-x86_64.AppImage"
# Rename the AppImage
file(GLOB appimages ${argWorkingDir}/*.AppImage)
foreach(appimage ${appimages})
get_filename_component(appimage_name ${appimage} NAME)
string(TOLOWER ${appimage_name} argAssetName)
string(REGEX REPLACE "appimage" "AppImage" appimage_name ${appimage_name})
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${appimage} ${appimage_name} WORKING_DIRECTORY ${argWorkingDir})
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${appimage} ${argAssetName}.AppImage WORKING_DIRECTORY ${argWorkingDir})
break()
endforeach()
endif()
# cmake-format: on