summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-11-07 16:51:41 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-11-07 16:51:41 +0200
commit7364e3e52e7bed9781493aedfb7be2a338146598 (patch)
tree7574144f6be79d489533e4bd3b551c80634e278e /CMakeLists.txt
parent159639b9f1d351a883127ff55ac93d814e430067 (diff)
macOS: Use Sparkle for automatic updates
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 11 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b0d8f70c..21cf1c7d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,9 +52,10 @@ option (ENABLE_MPG123 "Use mpg123 for decoding MPEG audio" ON)
52option (ENABLE_POPUP_MENUS "Use popup windows for context menus (if OFF, menus are confined inside main window)" ON) 52option (ENABLE_POPUP_MENUS "Use popup windows for context menus (if OFF, menus are confined inside main window)" ON)
53option (ENABLE_RELATIVE_EMBED "Resources should always be found via relative path" OFF) 53option (ENABLE_RELATIVE_EMBED "Resources should always be found via relative path" OFF)
54option (ENABLE_RESIZE_DRAW "Force window to redraw during resizing" ${DEFAULT_RESIZE_DRAW}) 54option (ENABLE_RESIZE_DRAW "Force window to redraw during resizing" ${DEFAULT_RESIZE_DRAW})
55option (ENABLE_SPARKLE "Use Sparkle for automatic updates (macOS)" OFF)
55option (ENABLE_WEBP "Use libwebp to decode .webp images (via pkg-config)" ON) 56option (ENABLE_WEBP "Use libwebp to decode .webp images (via pkg-config)" ON)
56option (ENABLE_WINDOWPOS_FIX "Set position after showing window (workaround for SDL bug)" OFF) 57option (ENABLE_WINDOWPOS_FIX "Set position after showing window (workaround for SDL bug)" OFF)
57option (ENABLE_WINSPARKLE "Use WinSparkle for automatic updates" OFF) 58option (ENABLE_WINSPARKLE "Use WinSparkle for automatic updates (Windows)" OFF)
58option (ENABLE_X11_SWRENDER "Use software rendering (X11)" OFF) 59option (ENABLE_X11_SWRENDER "Use software rendering (X11)" OFF)
59 60
60include (BuildType.cmake) 61include (BuildType.cmake)
@@ -98,9 +99,8 @@ list (APPEND RESOURCES ${FONTS})
98if ((UNIX AND NOT APPLE) OR MSYS) 99if ((UNIX AND NOT APPLE) OR MSYS)
99 list (APPEND RESOURCES res/lagrange-64.png) 100 list (APPEND RESOURCES res/lagrange-64.png)
100endif () 101endif ()
101make_resources (${CMAKE_CURRENT_BINARY_DIR}/resources.lgr ${RESOURCES})
102
103set (EMB_BIN ${CMAKE_CURRENT_BINARY_DIR}/resources.lgr) 102set (EMB_BIN ${CMAKE_CURRENT_BINARY_DIR}/resources.lgr)
103make_resources (${EMB_BIN} ${RESOURCES})
104set_source_files_properties (${EMB_BIN} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) 104set_source_files_properties (${EMB_BIN} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
105 105
106# Source files. 106# Source files.
@@ -150,7 +150,6 @@ set (SOURCES
150 src/stb_image.h 150 src/stb_image.h
151 src/stb_image_resize.h 151 src/stb_image_resize.h
152 src/stb_truetype.h 152 src/stb_truetype.h
153 src/updater.c
154 src/updater.h 153 src/updater.h
155 src/visited.c 154 src/visited.c
156 src/visited.h 155 src/visited.h
@@ -222,8 +221,11 @@ set (SOURCES
222 res/about/lagrange.gmi 221 res/about/lagrange.gmi
223 res/about/license.gmi 222 res/about/license.gmi
224 res/about/version.gmi 223 res/about/version.gmi
225 ${CMAKE_CURRENT_BINARY_DIR}/resources.lgr 224 ${EMB_BIN}
226) 225)
226if (NOT APPLE) # macos.m has Sparkle updater
227 list (APPEND SOURCES src/updater.c)
228endif ()
227if (ENABLE_IPC) 229if (ENABLE_IPC)
228 list (APPEND SOURCES 230 list (APPEND SOURCES
229 src/ipc.c 231 src/ipc.c
@@ -363,6 +365,9 @@ if (APPLE)
363 else () 365 else ()
364 target_link_libraries (app PUBLIC "-framework AppKit") 366 target_link_libraries (app PUBLIC "-framework AppKit")
365 endif () 367 endif ()
368 if (ENABLE_SPARKLE)
369 target_link_libraries (app PUBLIC sparkle)
370 endif ()
366 if (CMAKE_OSX_DEPLOYMENT_TARGET AND NOT IOS) 371 if (CMAKE_OSX_DEPLOYMENT_TARGET AND NOT IOS)
367 target_compile_options (app PUBLIC -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}) 372 target_compile_options (app PUBLIC -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET})
368 target_link_options (app PUBLIC -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}) 373 target_link_options (app PUBLIC -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET})
@@ -407,8 +412,7 @@ endif ()
407if (MSYS) 412if (MSYS)
408 target_link_libraries (app PUBLIC d2d1 uuid dwmapi) # querying DPI 413 target_link_libraries (app PUBLIC d2d1 uuid dwmapi) # querying DPI
409 if (ENABLE_WINSPARKLE) 414 if (ENABLE_WINSPARKLE)
410 target_link_libraries (app PUBLIC winsparkle) 415 target_link_libraries (app PUBLIC winsparkle)
411 target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_WINSPARKLE=1)
412 endif () 416 endif ()
413endif () 417endif ()
414if (UNIX) 418if (UNIX)