--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,7 +94,7 @@
 find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications
     KIO KCMUtils Service Solid Kirigami People WindowSystem GuiAddons DocTools Crash)
 
-if (WIN32)
+if (MSVC)
     get_filename_component(WINDOWS_KITS_DIR
         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
     file(READ "${WINDOWS_KITS_DIR}/SDKManifest.xml" SDK_MANIFEST)
