From d1d9262a75c5e435dc3a8aab7cacac7315609fed Mon Sep 17 00:00:00 2001 From: Ted Ralphs Date: Mon, 17 Apr 2023 11:27:24 -0400 Subject: [PATCH] Need to specify all dependencies explicitly now due. Fixes #173 --- setup.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index 0711252..2727367 100644 --- a/setup.py +++ b/setup.py @@ -51,18 +51,21 @@ def getBdistFriendlyString(s): except: # If user didn't supply location, then try pkg-config try: - flags = (check_output(['pkg-config', '--libs', 'cbc']) - .strip().decode('utf-8')) - libs = [flag[2:] for flag in flags.split() - if flag.startswith('-l')] - libDirs = [flag[2:] for flag in flags.split() - if flag.startswith('-L')] - flags = (check_output(['pkg-config', '--cflags', 'cbc']) - .strip().decode('utf-8')) - incDirs = [flag[2:] for flag in flags.split() if - flag.startswith('-I')] + for p in ['cbc','cgl','osi-clp','clp','osi','coinutils']: + flags = (check_output(['pkg-config', '--libs', p]) + .strip().decode('utf-8')) + for flag in flags.split(): + if flag.startswith('-l') and flag[2:] not in libs: + libs.append(flag[2:]) + if flag.startswith('-L') and flag[2:] not in libDirs: + libDirs.append(flag[2:]) + flags = (check_output(['pkg-config', '--cflags', p]) + .strip().decode('utf-8')) + for flag in flags.split(): + if flag.startswith('-I') and flag[2:] not in incDirs: + incDirs.append(flag[2:]) except: - # If pkg-config fails, then look for an installed Cbc + # If pkg-config fails, then look for an installed Cbc try: location = dirname( check_output(['which', 'cbc']).strip()).decode('utf-8')