--- a/src/analysis/CMakeLists.txt
+++ b/src/analysis/CMakeLists.txt
@@ -516,10 +516,10 @@
     ${CMAKE_SOURCE_DIR}/external/untwine/api
   )
 
-  IF(MSVC)
+  IF(WIN32)
     set_source_files_properties(
       ${CMAKE_SOURCE_DIR}/external/untwine/api/QgisUntwine.cpp
-      PROPERTIES COMPILE_FLAGS "/DUNICODE"
+      PROPERTIES COMPILE_DEFINITIONS "UNICODE"
     )
   endif()
 endif()
--- a/src/providers/pdal/CMakeLists.txt
+++ b/src/providers/pdal/CMakeLists.txt
@@ -14,10 +14,10 @@
   ${CMAKE_SOURCE_DIR}/external/untwine/api/QgisUntwine.cpp
 )
 
-IF(MSVC)
+IF(WIN32)
   set_source_files_properties(
     ${CMAKE_SOURCE_DIR}/external/untwine/api/QgisUntwine.cpp
-    PROPERTIES COMPILE_FLAGS "/DUNICODE"
+    PROPERTIES COMPILE_DEFINITIONS "UNICODE"
   )
 endif()
 
