CMake works for Linux but not for Windows: runtime error, DLLS not found

I have a CMake project which builds fine both on Windows and on Linux. However, the program only runs well on Linux. On Windows, it fails with a runtime error about the DLLs not being found in the runtime path:

[Qt]   Error(s):
[Qt]     Cannot load library C:\e\e\_Extensions\SlicerRT_R\inner-build\lib\Slicer-5.7\qt-loadable-modules\Release\qSlicerRoomsEyeViewModule.dll: The specified module could not be found.
DLL load failed while importing vtkSlicerBeamsModuleLogicPython: The specified module could not be found.

More details here:

I am out of ideas on what to try, since I am more an expert on the Linux side but have no experience in the Windows part.

Any orientation on what to try would be greatly appreciated. (If someone wants to reproduce the runtime error, one needs first to build Slicer3D and then the SlicerRt extension. Both are available open-source on GitHub.)

Windows does not have the concept of storage of paths inside the executable where to locate shared libraries. So you have to update PATH environment variable to expect the executable to find the shared libraries.

…or copy the library to the same directory.