How to detect whether the target platform is DLL/non-DLL?

I am trying to install runtime dependencies from an install script (install(SCRIPT)) using file(GET_RUNTIME_DEPENDENCIES) and file(INSTALL) because install(RUNTIME_DEPENDENCY_SET) doesn’t do everything I need. The documentation for install(RUNTIME_DEPENDENCY_SET) states, “The dependencies of targets belonging to a runtime dependency set are installed in the RUNTIME destination and component on DLL platforms, and in the LIBRARY destination and component on non-DLL platforms.” Based on this, I think my install script needs to detect whether the platform is DLL/non-DLL and copy the libraries to lib/ or bin/ accordingly.

But how should I detect whether the platform is DLL? install(RUNTIME_DEPENDENCY_SET) seems to use the value of CMAKE_IMPORT_LIBRARY_SUFFIX to detect this, but nothing in the documentation for CMAKE_IMPORT_LIBRARY_SUFFIX indicates that its value can be used to reliably determine whether the platform is DLL so I am hesitant to use it.

CMake makes the assumption that if the toolchain set an IMPORT_LIBRARY_SUFFIX, it’s a DLL platform. Non-DLL platforms don’t have implibs.

If you want to mirror install(RUNTIME_DEPENDENCY_SET), that’s what it’s doing, so relying on IMPORT_LIBRARY_SUFFIX being non-empty would be an accurate way to mirror its behavior.