build(macos): generate AetherSDR.icns at build time via CMake#2558
Merged
Conversation
Local cmake builds produced an .app bundle with no icon because the .icns was generated only by the macos-dmg CI workflow and never committed. The CMakeLists guard `if(EXISTS docs/AetherSDR.icns)` silently skipped the missing file, leaving the bundle iconless on every developer's machine. Move the sips/iconutil generation into CMake itself via add_custom_command, sourced from docs/logo-circle.png. macOS ships both tools, so no new build dependency is required. Drop the now- redundant manual step in macos-dmg.yml and point create-dmg's --volicon at the CMake-produced build/AetherSDR.icns. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ten9876
reviewed
May 10, 2026
ten9876
left a comment
Collaborator
There was a problem hiding this comment.
Claude here, reviewing on Jeremy's behalf.
Verdict
Solid fix for a real problem. Recommending merge.
Verified
- The bug is real.
docs/AetherSDR.icnsis not committed to the repo — the.icnsonly ever existed inside the macos-dmg CI runner. Every local macOS dev build hit theif(EXISTS "${MACOSX_ICON}")guard, skipped the icon, and produced a generic-icon.app. Confirmed by grepping the tree. - The fix is wired correctly.
add_custom_command(OUTPUT ICNS_PATH …)+target_sources(AetherSDR PRIVATE ICNS_PATH)+MACOSX_PACKAGE_LOCATION "Resources"is the textbook CMake pattern for generating a bundle resource at build time. CMake derives the dependency fromOUTPUT → DEPENDSand only re-runs whendocs/logo-circle.pngchanges. - Info.plist binding still works.
MACOSX_BUNDLE_ICON_FILE "AetherSDR.icns"is already set atCMakeLists.txt:746, andpackaging/macos/Info.plist.inconsumes it via${MACOSX_BUNDLE_ICON_FILE}. The new code lands the file atContents/Resources/AetherSDR.icnswith the same basename, so the existing plist reference resolves cleanly. - No new build dependencies.
sipsandiconutilare stock macOS tools shipped with every Xcode-equipped dev box. - Cross-platform safety. Entire block is inside
if(APPLE)— can't affect Linux or Windows builds. - CI is fully green —
build,analyze (cpp),check-paths,check-windows,CodeQLall SUCCESS.
Minor notes (non-blocking)
- The
add_custom_commandwrites tobuild/AetherSDR.iconset/and never cleans up. Harmless (it's inside the build dir, gets nuked withrm -rf build), but if you wanted to be tidy a final${CMAKE_COMMAND} -E rm -rf "${ICONSET_PATH}"step would do it. Not worth blocking on. - If a downstream contributor ever wants to rebuild on a non-macOS host that's hand-crafting a
.app(e.g. for cross-build), thesips/iconutilcalls would fail. That's not a real workflow we support — flagging only because the previous "skip if missing" guard tolerated it; the new version doesn't. The behavior change is a net win because silent fallback to no-icon was the original bug.
Thanks
Thanks to @jensenpat for the careful diagnosis and tight, minimal fix — exactly the right shape (single-purpose, deletes more than it adds, unifies CI and local paths). Appreciated.
73, Jeremy KK7GWY & Claude (AI dev partner)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Local
cmakebuilds on macOS were producing an.appbundle with no icon. The.icnswas generated only by themacos-dmg.ymlCI workflow and never committed, so theif(EXISTS docs/AetherSDR.icns)guard in CMakeLists silently skipped the missing file on every developer's machine.This PR moves the
sips+iconutilgeneration into CMake itself viaadd_custom_command, sourced fromdocs/logo-circle.png. macOS ships both tools by default, so there's no new build dependency. The redundant manual step inmacos-dmg.ymlis dropped, andcreate-dmg --voliconnow points at the CMake-producedbuild/AetherSDR.icns.Local and CI builds now go through the same code path.
Changes
CMakeLists.txt— replace theif(EXISTS .icns)guard with anadd_custom_commandthat producesbuild/AetherSDR.icnsfromdocs/logo-circle.pngat build time. CMake bundles it intoContents/Resources/viaMACOSX_PACKAGE_LOCATION..github/workflows/macos-dmg.yml— remove the manualGenerate .icns from PNGstep (now redundant); update--voliconto referencebuild/AetherSDR.icns.Verified
cmake -B build && cmake --build build -j10on macOS arm64 produces:build/AetherSDR.app/Contents/Resources/AetherSDR.icns(634 KB)Info.plistCFBundleIconFile→AetherSDR.icnsTest plan
cmake --build buildon macOS produces an.appwith the icon visible in Finder/Dock🤖 Generated with Claude Code