'cmake RUNTIME_DEPENDENCY_SET: cannot find qt5core.dll

I have a Qt5+cmake project which uses find_package to include Qt5::Core, and I'm adding RUNTIME_DEPENDENCY_SET to the install rules so that the project is able to install its runtime libraries, which includes Qt's dynamic libs. However when I run cmake --install . I get the following error:

D:\<PROJECT>\cmake-build-release>C:\Program Files\cmake\cmake.exe --install .
-- Install configuration: "Release"
-- Up-to-date: D:/<PROJECT>/Release/ProjectFoo.exe
CMake Error at cmake_install.cmake:123 (file):
  file Could not resolve file qt5core.dll

I was hoping that cmake would auto-magically resolve its shared libraries, but I might be missing something.

Does anyone know if this is possible, and in case it is what I might be missing?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source