|
14 | 14 | '''
|
15 | 15 |
|
16 | 16 | from subprocess import Popen, PIPE, STDOUT
|
17 |
| -import os, unittest, tempfile, shutil, time, inspect, sys, math, glob, tempfile, re, difflib, webbrowser, hashlib, BaseHTTPServer, threading |
| 17 | +import os, unittest, tempfile, shutil, time, inspect, sys, math, glob, tempfile, re, difflib, webbrowser, hashlib, BaseHTTPServer, threading, platform |
18 | 18 |
|
19 | 19 | # Setup
|
20 | 20 |
|
@@ -67,6 +67,15 @@ def skip(self, why):
|
67 | 67 | def get_dir(self):
|
68 | 68 | return self.working_dir
|
69 | 69 |
|
| 70 | + def get_shared_library_name(self, linux_name): |
| 71 | + if platform.system() == 'Linux': |
| 72 | + return linux_name |
| 73 | + elif platform.system() == 'Darwin': |
| 74 | + return linux_name.replace('.so', '') + '.dylib' |
| 75 | + else: |
| 76 | + print >> sys.stderr, 'get_shared_library_name needs to be implemented on %s' % platform.system() |
| 77 | + return linux_name |
| 78 | + |
70 | 79 | def get_stdout_path(self):
|
71 | 80 | return os.path.join(self.get_dir(), 'stdout')
|
72 | 81 |
|
@@ -4336,7 +4345,7 @@ def process(filename):
|
4336 | 4345 | shutil.copy(path_from_root('tests', 'openjpeg', 'opj_config.h'), self.get_dir())
|
4337 | 4346 |
|
4338 | 4347 | lib = self.get_library('openjpeg',
|
4339 |
| - [os.path.join('bin', 'libopenjpeg.so.1.4.0'), |
| 4348 | + [os.path.join('bin', self.get_shared_library_name('libopenjpeg.so.1.4.0')), |
4340 | 4349 | os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/index.c.o'.split('/')),
|
4341 | 4350 | os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/convert.c.o'.split('/')),
|
4342 | 4351 | os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/__/common/color.c.o'.split('/')),
|
|
0 commit comments