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

**URL:** <https://discourse.cmake.org/t/how-to-detect-whether-the-target-platform-is-dll-non-dll/15896>\
**Category:** Code\
**Created:** [October 31, 2026, 3:27pm UTC](https://discourse.cmake.org/t/how-to-detect-whether-the-target-platform-is-dll-non-dll/15896 "2026-10-31T15:27:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbear496](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/d/8baadc/32.png) [@dbear496](https://discourse.cmake.org/u/dbear496)\
**Post date:** [October 31, 2026, 3:27pm UTC](https://discourse.cmake.org/t/how-to-detect-whether-the-target-platform-is-dll-non-dll/15896/1 "2026-10-31T15:27:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vito.gamberini](https://discourse.cmake.org/user_avatar/discourse.cmake.org/vito.gamberini/32/4376_2.png) [@vito.gamberini](https://discourse.cmake.org/u/vito.gamberini)\
**Post date:** [October 31, 2026, 6:54pm UTC](https://discourse.cmake.org/t/how-to-detect-whether-the-target-platform-is-dll-non-dll/15896/2 "2026-10-31T18:54:36Z")

</div>

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.
