Loadable module with external binary dependencies

Hi,

I am new to slicer and I am trying to learn extension development for my Company’s internal use.

I am currently building an extension with a loadable module. This module depends on a few proprietary libraries distributed as .dll/.so.

So far I have managed to download these libraries from a server using Fetchcontent and linking against them.

I am not using Superbuild.

When I am trying to test my module using the SlicerWithExtension executable in the build folder, the required external dlls are not found.
Manually copying these from the download folder to build/lib/Slicer-5.7/qt-loadable-modules folder allows me to run my extension. When I create an install package, these libraries are not included.

What is the best practice to build and test against an extension depending on external binary libraries?

How can include those libraries in my extension package?

Thank you

It is a small implementation detail that no build step is needed for this external library. You can follow any superbuild extension as an example (for example, SlicerOpenIGTLink). You will set the build command to an empty string and add an install command that places the dlls are into the third-party bin folder. On macOS younalso need to fix up the rpath in shared libraries.

Thank you, that brings me one step closer.

I have now created a superbuild extension. The external project uses copy to install the dlls into the third-party bin folder.

This now allows me to directly run the TestWithExtension executable.

However, if I understand correctly, to include the dlls in the installation package, I also need to create an install target in the top-level CMakeList.txt to install the files from the third party bin folder.