pybind / cmake_example

Example pybind11 module built with a CMake-based build system
Other
626 stars 221 forks source link

Fix native_libs.txt #16

Closed ax3l closed 4 years ago

ax3l commented 6 years ago

When building additional, auxiliary libraries they should receive proper handling in "native_libs.txt". Surprisingly, this only happens when a trailing / is added.

Also, together with the primary module the (shared) libs will then go into the package directory instead of lying somewhere in the base path.

native_libs.txt also takes care, that these auxiliary, non-python, "native" libs are properly deinstalled as well.

Additional RPATH/RUNPATH handling for auxiliary, "native" libs is likely needed. E.g. on Linux when placing them all in the same base path ($ORIGIN is not a bash variable) of the package:

            '-DCMAKE_INSTALL_RPATH=$ORIGIN',
            '-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON',
            '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF',

while on Windows one can just keep a flat structure in the package, which will be in %PATH% for the primary module and its helper .dlls.

Larger project example: https://github.com/openPMD/openPMD-api/pull/240

leimao commented 4 years ago

This pull request got no responses?

ax3l commented 4 years ago

I know, right? :)

ping @dean0x7d and @SylvainCorlay

ax3l commented 4 years ago

@dean0x7d @wjakob who can merge this PR? Fixes #18 among other linked issues :)

wjakob commented 4 years ago

Sure, sorry about the delay.

ax3l commented 4 years ago

No problem, thanks!