Skip to content

Commit 7617662

Browse files
authored
add needed dll's to PATH for windows simulation (#136)
1 parent 1b68a80 commit 7617662

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

OMPython/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,9 +1242,10 @@ def simulate(self,resultfile=None,simflags=None): # 11
12421242
cmd = getExeFile + override + csvinput + r + simflags
12431243
#print(cmd)
12441244
if (platform.system() == "Windows"):
1245-
omhome = os.path.join(os.environ.get("OPENMODELICAHOME"), 'bin').replace("\\", "/")
1245+
omhome = os.path.join(os.environ.get("OPENMODELICAHOME"))
1246+
dllPath = os.path.join(omhome, "bin").replace("\\", "/") + os.pathsep + os.path.join(omhome, "lib/omc").replace("\\", "/") + os.pathsep + os.path.join(omhome, "lib/omc/cpp").replace("\\", "/") + os.pathsep + os.path.join(omhome, "lib/omc/omsicpp").replace("\\", "/")
12461247
my_env = os.environ.copy()
1247-
my_env["PATH"] = omhome + os.pathsep + my_env["PATH"]
1248+
my_env["PATH"] = dllPath + os.pathsep + my_env["PATH"]
12481249
p = subprocess.Popen(cmd, env=my_env)
12491250
p.wait()
12501251
p.terminate()

0 commit comments

Comments
 (0)