diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-11-07 16:51:41 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-11-07 16:51:41 +0200 |
commit | 7364e3e52e7bed9781493aedfb7be2a338146598 (patch) | |
tree | 7574144f6be79d489533e4bd3b551c80634e278e /CMakeLists.txt | |
parent | 159639b9f1d351a883127ff55ac93d814e430067 (diff) |
macOS: Use Sparkle for automatic updates
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
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) | |||
52 | option (ENABLE_POPUP_MENUS "Use popup windows for context menus (if OFF, menus are confined inside main window)" ON) | 52 | option (ENABLE_POPUP_MENUS "Use popup windows for context menus (if OFF, menus are confined inside main window)" ON) |
53 | option (ENABLE_RELATIVE_EMBED "Resources should always be found via relative path" OFF) | 53 | option (ENABLE_RELATIVE_EMBED "Resources should always be found via relative path" OFF) |
54 | option (ENABLE_RESIZE_DRAW "Force window to redraw during resizing" ${DEFAULT_RESIZE_DRAW}) | 54 | option (ENABLE_RESIZE_DRAW "Force window to redraw during resizing" ${DEFAULT_RESIZE_DRAW}) |
55 | option (ENABLE_SPARKLE "Use Sparkle for automatic updates (macOS)" OFF) | ||
55 | option (ENABLE_WEBP "Use libwebp to decode .webp images (via pkg-config)" ON) | 56 | option (ENABLE_WEBP "Use libwebp to decode .webp images (via pkg-config)" ON) |
56 | option (ENABLE_WINDOWPOS_FIX "Set position after showing window (workaround for SDL bug)" OFF) | 57 | option (ENABLE_WINDOWPOS_FIX "Set position after showing window (workaround for SDL bug)" OFF) |
57 | option (ENABLE_WINSPARKLE "Use WinSparkle for automatic updates" OFF) | 58 | option (ENABLE_WINSPARKLE "Use WinSparkle for automatic updates (Windows)" OFF) |
58 | option (ENABLE_X11_SWRENDER "Use software rendering (X11)" OFF) | 59 | option (ENABLE_X11_SWRENDER "Use software rendering (X11)" OFF) |
59 | 60 | ||
60 | include (BuildType.cmake) | 61 | include (BuildType.cmake) |
@@ -98,9 +99,8 @@ list (APPEND RESOURCES ${FONTS}) | |||
98 | if ((UNIX AND NOT APPLE) OR MSYS) | 99 | if ((UNIX AND NOT APPLE) OR MSYS) |
99 | list (APPEND RESOURCES res/lagrange-64.png) | 100 | list (APPEND RESOURCES res/lagrange-64.png) |
100 | endif () | 101 | endif () |
101 | make_resources (${CMAKE_CURRENT_BINARY_DIR}/resources.lgr ${RESOURCES}) | ||
102 | |||
103 | set (EMB_BIN ${CMAKE_CURRENT_BINARY_DIR}/resources.lgr) | 102 | set (EMB_BIN ${CMAKE_CURRENT_BINARY_DIR}/resources.lgr) |
103 | make_resources (${EMB_BIN} ${RESOURCES}) | ||
104 | set_source_files_properties (${EMB_BIN} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) | 104 | set_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 | ) |
226 | if (NOT APPLE) # macos.m has Sparkle updater | ||
227 | list (APPEND SOURCES src/updater.c) | ||
228 | endif () | ||
227 | if (ENABLE_IPC) | 229 | if (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 () | |||
407 | if (MSYS) | 412 | if (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 () |
413 | endif () | 417 | endif () |
414 | if (UNIX) | 418 | if (UNIX) |