from https://github.com/glfw/glfw/commit/3327050ca66ad34426a82c217c2d60ced61526b7
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -72,7 +72,7 @@ if (_GLFW_X11 OR _GLFW_WAYLAND)
     endif()
 endif()
 
-if (APPLE)
+if ("${CMAKE_VERSION}" VERSION_LESS "3.16" AND APPLE)
     # For some reason CMake didn't know about .m until version 3.16
     set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m
                                 cocoa_window.m nsgl_context.m PROPERTIES
