MattiaMontanari / openGJK

Fast and reliable implementation of the Gilbert-Johnson-Keerthi (GJK) algorithm for C, C#, Go, Matlab and Python
https://www.mattiamontanari.com/opengjk/
GNU General Public License v3.0
135 stars 37 forks source link

Fix library installation behavior #42

Closed turtlebasket closed 9 months ago

turtlebasket commented 1 year ago

Write access to /usr/lib on macOS 10 and up is restricted due to SIP, so the current method in make install of copying the dylib over to /usr/lib doesn't work on macOS.

I changed DESTDIR in CMakeLists.txt to accommodate for this:

if (UNIX)
    set(DESTDIR "/usr/local")
    INSTALL(TARGETS opengjk_ce 
        LIBRARY DESTINATION "${DESTDIR}/lib"
        PUBLIC_HEADER DESTINATION "${DESTDIR}/include"
        PERMISSIONS WORLD_WRITE
    )
endif (UNIX)

More broadly: at least from what I've seen, /usr/local/include and /usr/local/lib seem to be the standard target for make install, not /usr/include-/usr/lib, which are typically used for things that shipped with your unix distro.

This PR also includes minor .gitignore changes, namely cleaning up merge output and ignoring dylibs.

Are there any issues with this request?

turtlebasket commented 1 year ago

make install wasn't moving openGJK/openGJK.h into /usr/local/include either, just added that