Skip to content

Commit d64c19b

Browse files
committed
Add macOS cpack config. Currently requires some libs be provided by homebrew (see docs)
1 parent 698ff88 commit d64c19b

File tree

10 files changed

+43
-0
lines changed

10 files changed

+43
-0
lines changed

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,25 @@ set(CPACK_PACKAGE_VERSION_PATCH "0+${NGSCOPECLIENT_VERSION}")
294294
set(CPACK_PACKAGE_DESCRIPTION "Cross platform T&M remote control and signal analysis suite")
295295
set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.ngscopeclient.org/")
296296
set(CPACK_THREADS 0)
297+
set(CPACK_STRIP_FILES TRUE)
297298

298299
# Debian / Ubuntu specific packaging config
299300
# Versions are based on what Bookworm is shipping as of 2024-10-30
300301
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Andrew Zonenberg <andrew.zonenberg@antikernel.net>")
301302
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.36-9), libpng16-16(>= 1.6.39-2), libsigc++-2.0-0v5 (>= 2.12.0-1), libyaml-cpp0.7(>= 0.7.0), libgomp1(>= 12.2.0), libvulkan1(>= 1.3.239), libglfw3(>= 3.3.8), libgtk-3-0(>= 3.24.38), zlib1g(>= 1.2.13), libhidapi-hidraw0(>= 0.13.1), liblxi1(>= 1.18), libtirpc3 (>= 1.3.3)" )
302303

304+
if(APPLE)
305+
set(CPACK_BUNDLE "ON")
306+
set(CPACK_BUNDLE_PLIST "${PROJECT_SOURCE_DIR}/src/ngscopeclient/macos/Info.plist")
307+
# Must be generated with:
308+
# iconutil -c icns ngscopeclient.iconset
309+
set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/src/ngscopeclient/icons/macos/ngscopeclient.icns")
310+
set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/src/ngscopeclient/icons/macos/ngscopeclient.icns")
311+
set(CPACK_BUNDLE_NAME "ngscopeclient")
312+
set(CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/src/ngscopeclient/macos/ngscopeclient.sh")
313+
set_target_properties(ngscopeclient PROPERTIES
314+
INSTALL_RPATH "@executable_path/../lib;/usr/local/lib;/opt/homebrew/lib")
315+
endif()
316+
303317
# this must be at the very end *after* we've done all the config
304318
include(CPack)
2.31 MB
Binary file not shown.
22.7 KB
Loading
3.44 KB
Loading
79.7 KB
Loading
4.86 KB
Loading
425 KB
Loading
1.58 MB
Loading

src/ngscopeclient/macos/Info.plist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleExecutable</key>
6+
<string>ngscopeclient</string>
7+
<key>CFBundleIconFile</key>
8+
<string>ngscopeclient</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>org.ngscopeclient</string>
11+
<key>CFBundleDisplayName</key>
12+
<string>ngscopeclient</string>
13+
<key>CFBundlePackageType</key>
14+
<string>APPL</string>
15+
<key>LSArchitecturePriority</key>
16+
<string>arm64</string>
17+
</dict>
18+
</plist>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
BUNDLE="`echo "$0" | sed -e 's/\/Contents\/MacOS\/ngscopeclient//'`"
4+
RESOURCES="$BUNDLE/Contents/Resources"
5+
6+
export "PATH=$RESOURCES/bin:$PATH"
7+
8+
exec "$RESOURCES/bin/ngscopeclient"
9+
10+
#eof
11+

0 commit comments

Comments
 (0)