Skip to content

Commit 19a21e5

Browse files
committed
fix loading on windows
1 parent e6a7d02 commit 19a21e5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/ogdf_python/loader.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def get_base_include_path(include="ogdf/basic/Graph.h"):
6060
def get_include_path(name="ogdf/basic/Graph.h"):
6161
import ctypes
6262
s = ctypes.c_char_p()
63+
# FIXME IsFileInIncludePath uses some string splitting that doesn't work on Windows
6364
if cppyy.gbl.gSystem.IsFileInIncludePath(name, s):
6465
return s.value.decode()
6566
else:
@@ -117,7 +118,7 @@ def get_macro(m):
117118
elif line == "set_target_properties(OGDF PROPERTIES":
118119
active = True
119120

120-
includes =values.get("INTERFACE_INCLUDE_DIRECTORIES",None)
121+
includes = values.get("INTERFACE_INCLUDE_DIRECTORIES", None)
121122
if includes:
122123
includes = includes.replace(r"\$<IF:\$<CONFIG:Debug>,debug,release>", CONFIG_RD)
123124
for s in includes.split(";"):
@@ -136,9 +137,11 @@ def get_macro(m):
136137
try:
137138
wheel_inst_dir = importlib_resources.files("ogdf_wheel") / "install"
138139
if wheel_inst_dir.is_dir():
140+
# see https://cmake.org/cmake/help/latest/command/install.html#targets
139141
cppyy.add_library_path(str(wheel_inst_dir / "bin"))
140142
cppyy.add_library_path(str(wheel_inst_dir / "lib"))
141143
cppyy.add_include_path(str(wheel_inst_dir / "include"))
144+
cppyy.add_include_path(str(wheel_inst_dir / "include" / f"ogdf-{CONFIG_RD}"))
142145
except ImportError:
143146
pass
144147

@@ -152,11 +155,11 @@ def get_macro(m):
152155

153156
try:
154157
if IS_DEBUG:
155-
if platform.system() != "Windows": # Windows dll includes COIN
158+
if platform.system() != "Windows": # Windows dll includes COIN
156159
cppyy.load_library("COIN-debug")
157160
cppyy.load_library("OGDF-debug")
158161
else:
159-
if platform.system() != "Windows": # Windows dll includes COIN
162+
if platform.system() != "Windows": # Windows dll includes COIN
160163
cppyy.load_library("COIN")
161164
cppyy.load_library("OGDF")
162165

0 commit comments

Comments
 (0)