Skip to content
This repository was archived by the owner on Mar 7, 2024. It is now read-only.

Commit 2b0db86

Browse files
committed
find imgui shared library path
1 parent b9082cd commit 2b0db86

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

setup.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,18 @@ def backend_extras(*requirements):
116116
)
117117
}
118118

119+
def imgui_location():
120+
imgui_path = ''
121+
try:
122+
import imgui
123+
except ImportError:
124+
print('pyimgui module is required to build pyimplot')
125+
exit(1)
126+
finally:
127+
imgui_path = imgui.__path__[0]
128+
print(imgui_path)
129+
return imgui_path
130+
119131
# construct special 'full' extra that adds requirements for all built-in
120132
# backend integrations and additional extra features.
121133
EXTRAS_REQUIRE['full'] = list(set(chain(*EXTRAS_REQUIRE.values())))
@@ -152,8 +164,8 @@ def backend_extras(*requirements):
152164
# include_dirs=['implot', 'config-cpp', 'imgui-cpp', 'ansifeed-cpp', 'implot-cpp'],
153165
# include_dirs=['implot', 'config-cpp', 'imgui-cpp', 'implot-cpp'],
154166
include_dirs=['implot', 'config-cpp', 'imgui-cpp', 'implot-cpp'],
155-
# XXX: path to libimgui.so should not be hardcoded. Figure out the location of imgui..
156-
library_dirs=["implot", "../pyimgui-1.82/imgui"],
167+
library_dirs=["implot", imgui_location()],
168+
# order matters; libimplot needs to preceede libimgui!
157169
libraries=["implot", "imgui"],
158170
),
159171
]

0 commit comments

Comments
 (0)