Skip to content
Snippets Groups Projects
Commit 4ca1091f authored by Jay's avatar Jay
Browse files

Adds linux support for finding the shared library

parent 377bd23a
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ import ctypes ...@@ -2,6 +2,7 @@ import ctypes
from ctypes.util import find_library from ctypes.util import find_library
from glob import glob from glob import glob
import os import os
import sys
import warnings import warnings
# Register the usgscam plugin with the csmapi # Register the usgscam plugin with the csmapi
...@@ -12,8 +13,12 @@ if not libusgscsm_path: ...@@ -12,8 +13,12 @@ if not libusgscsm_path:
usgscsm_folder = os.path.join(os.path.split(libcsmapi_path)[0], "csmplugins") usgscsm_folder = os.path.join(os.path.split(libcsmapi_path)[0], "csmplugins")
libusgscsm_path = "" libusgscsm_path = ""
if os.path.exists(usgscsm_folder): if os.path.exists(usgscsm_folder):
print(sys.platform)
# Supports py < 3.10, if only supporting 3.10+ use: glob( "*[0-9].[0-9].[0-9].dylib", root_dir=usgscsm_folder) # Supports py < 3.10, if only supporting 3.10+ use: glob( "*[0-9].[0-9].[0-9].dylib", root_dir=usgscsm_folder)
results = glob(os.path.join(usgscsm_folder, "*[0-9].[0-9].[0-9].dylib")) if sys.platform.startswith('darwin'):
results = glob(os.path.join(usgscsm_folder, "*[0-9].[0-9].[0-9].dylib"))
elif sys.platform.startswith('linux'):
results = glob(os.path.join(usgscsm_folder, "*.so"))
results.sort() results.sort()
libusgscsm_path = os.path.join(usgscsm_folder, results[-1]) libusgscsm_path = os.path.join(usgscsm_folder, results[-1])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment