diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8d73d0e..896f3a0 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -65,6 +65,23 @@ jobs: echo "OPENSSL_INCLUDE_DIR=/opt/homebrew/opt/openssl@3/include" >> $GITHUB_ENV echo "PKG_CONFIG_PATH=/opt/homebrew/opt/openssl@3/lib/pkgconfig" >> $GITHUB_ENV + - name: Convert PNG to ICNS + run: | + mkdir -p build/icon.iconset + # Generate required icon sizes + sips -z 16 16 src/macos/icon.png --out build/icon.iconset/icon_16x16.png + sips -z 32 32 src/macos/icon.png --out build/icon.iconset/icon_16x16@2x.png + sips -z 32 32 src/macos/icon.png --out build/icon.iconset/icon_32x32.png + sips -z 64 64 src/macos/icon.png --out build/icon.iconset/icon_32x32@2x.png + sips -z 128 128 src/macos/icon.png --out build/icon.iconset/icon_128x128.png + sips -z 256 256 src/macos/icon.png --out build/icon.iconset/icon_128x128@2x.png + sips -z 256 256 src/macos/icon.png --out build/icon.iconset/icon_256x256.png + sips -z 512 512 src/macos/icon.png --out build/icon.iconset/icon_256x256@2x.png + sips -z 512 512 src/macos/icon.png --out build/icon.iconset/icon_512x512.png + sips -z 1024 1024 src/macos/icon.png --out build/icon.iconset/icon_512x512@2x.png + # Convert to icns + iconutil -c icns build/icon.iconset -o build/umskt.icns + - name: Configure and build UMSKT run: | cd build diff --git a/CMakeLists.txt b/CMakeLists.txt index fb6af08..166eb45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,8 +252,27 @@ ELSE() TARGET_LINK_DIRECTORIES(_umskt PUBLIC ${UMSKT_LINK_DIRS}) TARGET_LINK_LIBRARIES(_umskt ${OPENSSL_CRYPTO_LIBRARIES} fmt ${UMSKT_LINK_LIBS}) + # Set up macOS bundle icon + if(APPLE) + set(MACOSX_BUNDLE_ICON_FILE umskt.icns) + set(APP_ICON_MACOSX ${CMAKE_BINARY_DIR}/umskt.icns) + set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") + endif() + ### UMSKT executable compilation - ADD_EXECUTABLE(umskt src/main.cpp src/cli.cpp ${UMSKT_EXE_WINDOWS_EXTRA}) + ADD_EXECUTABLE(umskt src/main.cpp src/cli.cpp ${UMSKT_EXE_WINDOWS_EXTRA} ${APP_ICON_MACOSX}) + if(APPLE) + set_target_properties(umskt PROPERTIES + MACOSX_BUNDLE TRUE + MACOSX_BUNDLE_BUNDLE_NAME "UMSKT" + MACOSX_BUNDLE_GUI_IDENTIFIER "com.umskt.app" + MACOSX_BUNDLE_ICON_FILE "umskt.icns" + MACOSX_BUNDLE_INFO_STRING "UMSKT" + MACOSX_BUNDLE_LONG_VERSION_STRING "1.0.0" + MACOSX_BUNDLE_SHORT_VERSION_STRING "1.0" + MACOSX_BUNDLE_BUNDLE_VERSION "1.0.0" + ) + endif() TARGET_INCLUDE_DIRECTORIES(umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(umskt _umskt ${OPENSSL_CRYPTO_LIBRARIES} ${ZLIB_LIBRARIES} fmt nlohmann_json::nlohmann_json umskt::rc ${UMSKT_LINK_LIBS}) TARGET_LINK_DIRECTORIES(umskt PUBLIC ${UMSKT_LINK_DIRS}) diff --git a/src/windows/icon_LICENSE b/src/icon_LICENSE similarity index 100% rename from src/windows/icon_LICENSE rename to src/icon_LICENSE diff --git a/src/macos/icon.png b/src/macos/icon.png new file mode 100644 index 0000000..5b9aa54 Binary files /dev/null and b/src/macos/icon.png differ diff --git a/src/windows/icon.ico b/src/windows/icon.ico index cb5106f..6c23505 100644 Binary files a/src/windows/icon.ico and b/src/windows/icon.ico differ