File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,9 +86,18 @@ function(vtksdk_generate_package_init package_name)
8686 set (need_del_vtkmodules TRUE )
8787 endforeach ()
8888
89+ # On windows we have to register third_party directories using os.add_dll_directory
90+ if (WIN32 )
91+ string (APPEND PACKAGE_INIT "import os\n " "from pathlib import Path\n " )
92+ string (APPEND PACKAGE_INIT "os.add_dll_directory(Path(os.curdir) / \" third_party.libs\" ).resolve().as_posix()\n " )
93+ foreach (dep IN LISTS arg_DEPENDENCIES)
94+ string (APPEND PACKAGE_INIT "os.add_dll_directory(Path(os.curdir) / \" ..\" / \" ${dep} \" / \" third_party.libs\" ).resolve().as_posix()\n " )
95+ endforeach ()
96+ endif ()
97+
8998 # Generate import of given dependencies
90- foreach (module IN LISTS arg_DEPENDENCIES)
91- string (APPEND PACKAGE_INIT "import ${module } \n " )
99+ foreach (dep IN LISTS arg_DEPENDENCIES)
100+ string (APPEND PACKAGE_INIT "import ${dep } \n " )
92101 endforeach ()
93102
94103 # Generate import of given modules
@@ -105,8 +114,8 @@ function(vtksdk_generate_package_init package_name)
105114 if (need_del_vtkmodules)
106115 string (APPEND PACKAGE_UNINIT "del vtkmodules\n " )
107116 endif ()
108- foreach (module IN LISTS arg_DEPENDENCIES)
109- string (APPEND PACKAGE_UNINIT "del ${module } \n " )
117+ foreach (dep IN LISTS arg_DEPENDENCIES)
118+ string (APPEND PACKAGE_UNINIT "del ${dep } \n " )
110119 endforeach ()
111120 string (APPEND PACKAGE_UNINIT "# END: Generated automatically by VTK-SDK helper\n " )
112121
You can’t perform that action at this time.
0 commit comments