WIP: auto update

This commit is contained in:
SoftFever
2026-01-04 21:47:07 +08:00
parent 7c91459c37
commit e35f4dbf62
17 changed files with 1141 additions and 158 deletions

17
deps/CMakeLists.txt vendored
View File

@@ -386,6 +386,16 @@ endif ()
include(OCCT/OCCT.cmake)
include(OpenCV/OpenCV.cmake)
# WinSparkle for Windows auto-updates
if(WIN32)
include(WinSparkle/WinSparkle.cmake)
endif()
# Sparkle 2 for macOS auto-updates
if(APPLE)
include(Sparkle/Sparkle.cmake)
endif()
set(_dep_list
dep_Boost
dep_TBB
@@ -410,12 +420,19 @@ set(_dep_list
if (MSVC)
# Experimental
#list(APPEND _dep_list "dep_qhull")
# WinSparkle for auto-updates
list(APPEND _dep_list "dep_WinSparkle")
else()
list(APPEND _dep_list "dep_Qhull")
# Not working, static build has different Eigen
#list(APPEND _dep_list "dep_libigl")
endif()
if (APPLE)
# Sparkle 2 for auto-updates
list(APPEND _dep_list "dep_Sparkle")
endif()
add_custom_target(deps ALL DEPENDS ${_dep_list})
# Note: I'm not using any of the LOG_xxx options in ExternalProject_Add() commands

27
deps/Sparkle/Sparkle.cmake vendored Normal file
View File

@@ -0,0 +1,27 @@
# Sparkle 2 - Auto-update framework for macOS
# https://sparkle-project.org/
# https://github.com/sparkle-project/Sparkle
#
# Sparkle is distributed as a pre-built framework, so we just download and extract.
if(APPLE)
set(SPARKLE_VERSION "2.8.1")
ExternalProject_Add(
dep_Sparkle
EXCLUDE_FROM_ALL ON
URL "https://github.com/sparkle-project/Sparkle/releases/download/${SPARKLE_VERSION}/Sparkle-${SPARKLE_VERSION}.tar.xz"
URL_HASH SHA256=5cddb7695674ef7704268f38eccaee80e3accbf19e61c1689efff5b6116d85be
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/Sparkle
# No build step needed - just install pre-built framework and tools
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DESTDIR}/Frameworks
COMMAND ${CMAKE_COMMAND} -E copy_directory
<SOURCE_DIR>/Sparkle.framework ${DESTDIR}/Frameworks/Sparkle.framework
# Also install the Sparkle CLI tools (sign_update, generate_appcast) for CI/CD signing
COMMAND ${CMAKE_COMMAND} -E make_directory ${DESTDIR}/bin
COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/bin/sign_update ${DESTDIR}/bin/sign_update
COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/bin/generate_appcast ${DESTDIR}/bin/generate_appcast
)
endif()

33
deps/WinSparkle/WinSparkle.cmake vendored Normal file
View File

@@ -0,0 +1,33 @@
# WinSparkle - Auto-update framework for Windows
# https://winsparkle.org/
# https://github.com/vslavik/winsparkle
#
# WinSparkle is distributed as pre-built binaries, so we just download and extract.
if(WIN32)
set(WINSPARKLE_VERSION "0.8.3")
# Determine architecture
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(WINSPARKLE_ARCH "x64")
else()
set(WINSPARKLE_ARCH "x86")
endif()
ExternalProject_Add(
dep_WinSparkle
EXCLUDE_FROM_ALL ON
URL "https://github.com/vslavik/winsparkle/releases/download/v${WINSPARKLE_VERSION}/WinSparkle-${WINSPARKLE_VERSION}.zip"
URL_HASH SHA256=5ff4a4604c78d57e01d83e22f79f5ffea0c4969defd48b45c69ccbd6b1a71e94
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/WinSparkle
# No build step needed - just install pre-built binaries
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory
<SOURCE_DIR>/include ${DESTDIR}/include
COMMAND ${CMAKE_COMMAND} -E copy
<SOURCE_DIR>/${WINSPARKLE_ARCH}/Release/WinSparkle.dll ${DESTDIR}/bin/WinSparkle.dll
COMMAND ${CMAKE_COMMAND} -E copy
<SOURCE_DIR>/${WINSPARKLE_ARCH}/Release/WinSparkle.lib ${DESTDIR}/lib/WinSparkle.lib
)
endif()