This question asks about similar question, but only requires to manually specify which dlls to copy. My question is: is there a way to simply let CMake to copy all dlls that are linked to the executable library, without manually telling the CMake which files to copy? Sometimes CMake knows more about whether the dlls is needed. For example, in a system where both dlls and static libs for the same library (e.g. Boost) are installed and we choose to link to Boost statically, then we don't need to copy the dll. So CMake can make a better decision than manually specifying which files to copy. Another example is, my QT library links to ICU library, and when writing CMakeLists.txt, I have no knowledge about that, so I can't possibly tell CMake to copy over the ICU dlls, so this should be done by CMake instead of human.
Suppose the OS is Windows.