indilib / pyindi-client

GNU General Public License v3.0
20 stars 9 forks source link

Custom path for libindiclient.a #38

Open jodier opened 12 months ago

jodier commented 12 months ago

Dear pyindi-client deceloppers,

Would it be possible to implement something to make it possible to specify a custom libindiclient.a path when installing pyindi-client?

It's a very interesting feature to embed "libindiclient.a" and "pyindi-client" in an application and not only in "/usr/lib/" + march, "/usr/lib", "/usr/lib64", "/lib", "/lib64", "/usr/local/lib/" + march and "/usr/local/lib".

To do so (and be compatible with both a "python setup.py install" and "pip install pyindi-client"), the solution is to add an environment variable (for example _INDICLIENTPATH):

...

if "LIBINDICLIENT_PATH" in os.environs:
    libindisearchpaths.append(os.environs["LIBINDICLIENT_PATH"])

libindipath = ""

...

And regenerate setup.cfg:

[build_ext]

swig_opts = -v -Wall -c++ -threads -I<LIBINDICLIENT_PATH>/include/libindi

include_dirs = <LIBINDICLIENT_PATH>/include/libindi

library_dirs = <LIBINDICLIENT_PATH>/lib

libraries = cfitsio nova z

Best regards, Jérôme

tbowers7 commented 1 month ago

I second a request for this feature.

knro commented 1 month ago

Can anyone submit a PR for this? It would be greatly appreciated.