Skip to content
Snippets Groups Projects
Commit ea52864b authored by jay's avatar jay
Browse files

Correct installation

parent 7302d240
No related branches found
No related tags found
No related merge requests found
...@@ -2,13 +2,34 @@ import setuptools.command.install ...@@ -2,13 +2,34 @@ import setuptools.command.install
import shutil import shutil
from distutils.sysconfig import get_python_lib from distutils.sysconfig import get_python_lib
class CompiledLibInstall(setuptools.command.install.install):
"""
Specialized install to install to python libs
"""
def run(self):
"""
Run method called by setup
:return:
"""
# Get filenames from CMake variable
filenames = '${PYTHON_INSTALL_FILES}'.split(';')
# Directory to install to
install_dir = get_python_lib()
# Install files
[shutil.copy(filename, install_dir) for filename in filenames]
if __name__ == '__main__': if __name__ == '__main__':
setuptools.setup( setuptools.setup(
name='csmapi', name='csmapi',
version='0.1.0', version='0.1.0',
py_modules=['csmapi'], packages=['csmapi'],
package_data={'csmapi':['_csmapi.so']}, cmdclass={'install':CompiledLibInstall},
license='UnLicense', license='UnLicense',
author='jlaura', author='jlaura',
zip_safe=False,
author_email='jlaura@usgs.gov' author_email='jlaura@usgs.gov'
) )
\ No newline at end of file
...@@ -8,7 +8,9 @@ import pytest ...@@ -8,7 +8,9 @@ import pytest
import csmapi import csmapi
# Load a plugin with CSM compliant sensors # Load a plugin with CSM compliant sensors
lib = ctypes.CDLL('/data/big/github/CSM-CameraModel/build/libusgscsm.so') from ctypes.util import find_library
lib = ctypes.CDLL(find_library('usgscsm.so'))
@pytest.fixture @pytest.fixture
def datadir(tmpdir, request): def datadir(tmpdir, request):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment