access to libs
This commit is contained in:
parent
d348e8c563
commit
5be3fe4555
31
packages/python/swig/yap4py/__init__.py.in
Normal file
31
packages/python/swig/yap4py/__init__.py.in
Normal file
@ -0,0 +1,31 @@
|
||||
import imp
|
||||
import os
|
||||
import ctypes
|
||||
import glob
|
||||
import os.path
|
||||
import platform
|
||||
import sys
|
||||
|
||||
global yap_lib_path
|
||||
yap_lib_path = "@CMAKE_INSTALL_FULL_LIBDIR@"
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
def load( dll ):
|
||||
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
|
||||
dll = os.path.abspath(dll)
|
||||
ctypes.WinDLL(dll)
|
||||
elif platform.system() == 'Apple':
|
||||
def load( dll ):
|
||||
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
|
||||
dll = os.path.abspath(dll)
|
||||
ctypes.CDLL(dll)
|
||||
load('libYap.dylib')
|
||||
load('libPy4YAP.dylib')
|
||||
else:
|
||||
def load( dll ):
|
||||
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
|
||||
dll = os.path.abspath(dll)
|
||||
ctypes.CDLL(dll)
|
||||
load('libYap.so')
|
||||
load('libPy4YAP.so')
|
||||
|
Reference in New Issue
Block a user