diff options
Diffstat (limited to 'src/SConscript')
-rw-r--r-- | src/SConscript | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/SConscript b/src/SConscript index 60e13b6..89fe502 100644 --- a/src/SConscript +++ b/src/SConscript @@ -1,14 +1,14 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -import sys import os.path +from glob import glob +from distutils.sysconfig import get_python_inc, get_python_lib env = Environment() # Include directories to look for 'Python.h' in -python_inc_path = os.path.join(sys.prefix, 'include', 'python' + sys.version[:3]) -env.Append(CPPPATH=[python_inc_path]) +env.Append(CPPPATH=[get_python_inc(plat_specific=True)]) # Libraries to link against libs = ['boost_python', 'exiv2'] @@ -18,15 +18,16 @@ env.Append(LIBS=libs) cpp_sources = ['exiv2wrapper.cpp', 'exiv2wrapper_python.cpp'] libpyexiv2 = env.SharedLibrary('exiv2python', cpp_sources) -# Install the shared library and the Python module, invoked using +# Install the shared library and the Python modules, invoked using # 'scons install'. If DESTDIR is specified on the command line when invoking # scons, it will be prepended to each installed target file. See # http://www.gnu.org/prep/standards/html_node/DESTDIR.html for reference. -python_lib_path = os.path.join(sys.prefix, 'lib', 'python' + sys.version[:3], 'site-packages') +python_lib_path = get_python_lib(plat_specific=True) dest_dir = ARGUMENTS.get('DESTDIR') if (dest_dir is None) or (not os.path.isabs(dest_dir)): install_dir = python_lib_path else: install_dir = os.path.join(dest_dir, python_lib_path[1:]) -env.Install(install_dir, [libpyexiv2, 'pyexiv2.py']) +env.Install(install_dir, [libpyexiv2]) +env.Install(os.path.join(install_dir, 'pyexiv2'), glob('pyexiv2/*.py')) env.Alias('install', install_dir) |