From b252922b0adb0912604901a72651ffb2cfc95ea2 Mon Sep 17 00:00:00 2001
From: Shaun Reed <shaunrd0@gmail.com>
Date: Fri, 14 Mar 2025 15:49:23 -0400
Subject: [PATCH] Finish fixing windows CI.

:')
---
 resources/icons/win/win-icons.sh |  2 +-
 src/CMakeLists.txt               | 47 ++++++++++++++++----------------
 2 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/resources/icons/win/win-icons.sh b/resources/icons/win/win-icons.sh
index f6b4a46..9d772ba 100755
--- a/resources/icons/win/win-icons.sh
+++ b/resources/icons/win/win-icons.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 # $1: Input path to an image to use for generating icons.
-# Helper script to generate qtk's icons for OSX given a path to an input PNG.
+# Helper script to generate qtk's icons for Windows given a path to an input PNG.
 sudo apt install imagemagick
 
 # For the NSIS (un)installer executable shortcut icon.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 79bf517..1d25c05 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -126,7 +126,29 @@ if (QTK_SUBMODULES)
   list(REMOVE_ITEM CPACK_COMPONENTS_ALL Unspecified)
 endif()
 
-if(APPLE)
+if(WIN32)
+  # Windows
+  # Set icon for the splash image used in Windows NSIS installers.
+  # TODO: Fix NSIS cmake error
+  # File: "D:/a/qtk/qtk/resources/icons/win/kilroy_splash.bmp" -> no files found.
+  #set(CPACK_PACKAGE_ICON "${QTK_RESOURCES}/icons/win/kilroy_splash.bmp")
+  set(CPACK_NSIS_MODIFY_PATH ON)
+  set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
+  # https://nsis.sourceforge.io/Reference/CreateShortCut
+  set(
+      CPACK_NSIS_CREATE_ICONS_EXTRA
+      "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Qtk.lnk' '$INSTDIR\\\\bin\\\\qtk_gui.exe'"
+  )
+  set(
+      CPACK_NSIS_DELETE_ICONS_EXTRA
+      "Delete '$SMPROGRAMS\\\\$START_MENU\\\\Qtk.lnk'"
+  )
+
+  # Set icon for the installer executable.
+  set(CPACK_NSIS_MUI_ICON "${QTK_RESOURCES}/icons/win/kilroy.ico")
+  # Set icon for uninstaller executable.
+  set(CPACK_NSIS_MUI_UNIICON "${QTK_RESOURCES}/icons/win/kilroy.ico")
+elseif(APPLE)
   # OSX
   # Set icon for the splash image used in OSX DMG installers.
   set(CPACK_PACKAGE_ICON "${QTK_RESOURCES}/icons/osx/kilroy_splash.bmp")
@@ -166,29 +188,6 @@ else(UNIX)
   set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
 endif()
 
-
-# Windows
-# Set icon for the splash image used in Windows NSIS installers.
-# TODO: Fix NSIS cmake error
-# File: "D:/a/qtk/qtk/resources/icons/win/kilroy_splash.bmp" -> no files found.
-#set(CPACK_PACKAGE_ICON "${QTK_RESOURCES}/icons/win/kilroy_splash.bmp")
-set(CPACK_NSIS_MODIFY_PATH ON)
-set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
-# https://nsis.sourceforge.io/Reference/CreateShortCut
-set(
-    CPACK_NSIS_CREATE_ICONS_EXTRA
-    "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Qtk.lnk' '$INSTDIR\\\\bin\\\\qtk_gui.exe'"
-)
-set(
-    CPACK_NSIS_DELETE_ICONS_EXTRA
-    "Delete '$SMPROGRAMS\\\\$START_MENU\\\\Qtk.lnk'"
-)
-
-# Set icon for the installer executable.
-set(CPACK_NSIS_MUI_ICON "${QTK_RESOURCES}/icons/win/kilroy.ico")
-# Set icon for uninstaller executable.
-set(CPACK_NSIS_MUI_UNIICON "${QTK_RESOURCES}/icons/win/kilroy.ico")
-
 if(WIN32)
   set(CPACK_SOURCE_GENERATOR ZIP)
 else()