diff --git a/cmake/GtsamCythonWrap.cmake b/cmake/GtsamCythonWrap.cmake index a3d3b661c..f1382729f 100644 --- a/cmake/GtsamCythonWrap.cmake +++ b/cmake/GtsamCythonWrap.cmake @@ -88,9 +88,12 @@ endfunction() function(build_cythonized_cpp target cpp_file output_lib_we output_dir) add_library(${target} MODULE ${cpp_file}) - # Use .pyd extension instead of .dll on Windows if(WIN32) + # Use .pyd extension instead of .dll on Windows set_target_properties(${target} PROPERTIES SUFFIX ".pyd") + + # Add full path to the Python library + target_link_libraries(${target} ${PYTHON_LIBRARIES}) endif() if(APPLE)