From 0a1ca612dbee7b7e6fed1ae55be2123bf3a10bf2 Mon Sep 17 00:00:00 2001 From: Stefan Vigerske Date: Thu, 20 Aug 2020 12:37:22 +0200 Subject: [PATCH] add convertion of msys-libdir to windows-bindir --- gamsinst.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gamsinst.py b/gamsinst.py index 2171475e..d3bdecb2 100755 --- a/gamsinst.py +++ b/gamsinst.py @@ -2,6 +2,7 @@ import sys import os +import subprocess import shutil def print_usage() : @@ -60,6 +61,11 @@ def print_usage() : print("Error: no libdir or dlname found in", solverlib, file=sys.stderr) print_usage() sys.exit(1) + if iswindows : + # convert msys-path to windows path + libdir = subprocess.check_output("cygpath -w " + libdir).decode("utf-8").strip() + # on Windows, DLLs are in bindir and not in libdir, assume bindir is libdir/../bin + libdir = os.path.join(libdir, '..', 'bin') solverlib = os.path.join(libdir, dlname) if not os.path.isfile(solverlib) : print("Error: %s does not exist or is not a file" % solverlib, file=sys.stderr)