diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6de20290cdb6eed443d70b9fe3a06974bf91dd7c..5d4e3c27271876bd9cc231485f62f8041f7dd54a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -647,7 +647,8 @@ else()
 endif()
 
 if ( WALBERLA_BUILD_WITH_PYTHON AND WALBERLA_CXX_COMPILER_IS_MSVC )
-    list( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS python36 )
+    get_filename_component(PYTHON_REQUIRED_LIB ${PYTHON_LIBRARY} NAME_WE)
+    list( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS ${PYTHON_REQUIRED_LIB} )
 endif()
 
 # This variable is necessary, if the CMAKE version used is not aware of a more recent boost version (keep this up to date!)