--- a/openvdb/openvdb/python/CMakeLists.txt
+++ b/openvdb/openvdb/python/CMakeLists.txt
@@ -271,7 +271,9 @@
 if(UNIX)
   set_target_properties(pyopenvdb PROPERTIES SUFFIX ".so") # must be .so (not .dylib)
 elseif(WIN32)
-  set_target_properties(pyopenvdb PROPERTIES SUFFIX ".pyd") # .pyd on windows
+  execute_process(COMMAND ${Python_EXECUTABLE} -c "import distutils.sysconfig, sys; get = distutils.sysconfig.get_config_var; sys.stdout.write(get('EXT_SUFFIX') or get('SO') or '.pyd');"
+                  OUTPUT_VARIABLE PYTHON_MOD_EXT)
+  set_target_properties(pyopenvdb PROPERTIES SUFFIX "${PYTHON_MOD_EXT}")
 endif()
 
 target_include_directories(pyopenvdb SYSTEM PUBLIC ${OPENVDB_PYTHON_INCLUDES})
