Make sai library shared library, add install directives#21
Conversation
|
Oh gosh sorry I managed to miss this for all this time, I'll get this merged soon! |
|
This looks good for a re-usable library, though I don't think this should be the default behavior and should instead be a CMake option of some kind. The Does the library need to be shared in particular? I'd feel better about it just having to install a static library file( |
There was a problem hiding this comment.
I'm obviously not the author of libsai but just a random user, but why not make use of the CMake BUILD_SHARED_LIBS option? Hardcode it as a shared library is probably not the best option I guess?
In general we can put something like this in the CMakeLists.txt file, and make it defaults to ON if we want shared libs by default or OFF if otherwise:
option(BUILD_SHARED_LIBS "Prefer to build shared lib" ON)And for installation, it could be better if we could reuse GNUInstallDirs too.
… use GNUInstallDirs for install targets
|
Thanks for the comments. I added a new commit to this pull request that:
|
|
Looks good to me! Thank you both for your insight and contribution 🙏 |
Hi,
Thanks for providing this library!
I'm working on adding libsai support to my application, and for that needed to adjust the install process to also build a shared library and to install the files into the respective locations. This adds to CMakeLists.txt the
SHAREDkeyword to theadd_librarycommand and providesinstalldirectives for the executables, the header file, and the library itself.