# Install library with GET\_RUNTIME\_DEPENDENCIES from POST\_EXCLUDE\_FILES\_STRICT

**URL:** https://discourse.cmake.org/t/install-library-with-get-runtime-dependencies-from-post-exclude-files-strict/5715
**Category:** Usage
**Created:** [May 23, 2022, 7:42pm UTC](https://discourse.cmake.org/t/install-library-with-get-runtime-dependencies-from-post-exclude-files-strict/5715 "2022-05-23T19:42:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![NathanielMcVicar](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nathanielmcvicar/32/2445_2.png) [@NathanielMcVicar](https://discourse.cmake.org/u/NathanielMcVicar)
#### Post date: [May 23, 2022, 7:42pm UTC](https://discourse.cmake.org/t/install-library-with-get-runtime-dependencies-from-post-exclude-files-strict/5715/1 "2022-05-23T19:42:21Z")

</div>

I’ve looked through the many posts about GET\_RUNTIME\_DEPENDENCIES and don’t see my question answered, but I apologize if I missed something.

I am trying to install some libraries required for a target. These libraries are not installed normally because they come from a submodule which builds them but excludes them from INSTALL. I only want to install the libraries from this submodule that are required for my target, not all that are built.

Unfortunately, because these .sos are in the dependency set for my target they are added to POST\_EXCLUDE\_FILES\_STRICT for GET\_RUNTIME\_DEPENDENCIES here [Source/cmInstallGetRuntimeDependenciesGenerator.cxx:192](https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmInstallGetRuntimeDependenciesGenerator.cxx#L192).

Is there a better way to install dependencies like this? I can manually install the TARGETS I need, but this seems brittle and GET\_RUNTIME\_DEPENDENCIES is perfect, except for this exclusion. Thanks!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [May 23, 2022, 7:49pm UTC](https://discourse.cmake.org/t/install-library-with-get-runtime-dependencies-from-post-exclude-files-strict/5715/2 "2022-05-23T19:49:36Z")

</div>

This is documented. The genex explicitly excludes files generated by the current build system (to avoid double installation). You should add install rules for the submodule’s targets.

---

<div class="post-metadata">

### Author: ![NathanielMcVicar](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nathanielmcvicar/32/2445_2.png) [@NathanielMcVicar](https://discourse.cmake.org/u/NathanielMcVicar)
#### Post date: [May 23, 2022, 10:43pm UTC](https://discourse.cmake.org/t/install-library-with-get-runtime-dependencies-from-post-exclude-files-strict/5715/3 "2022-05-23T22:43:21Z")

</div>

The submodule dependencies are transitive through a number of different targets using target\_link\_librarires, all subject to change, so I am trying to avoid listing them with my install. My current workaround is to create a RUNTIME\_DEPENDENCY\_SET with IMPORTED\_RUNTIME\_ARTIFACTS and install the set, which gets around the exclusion, but I imagine there is cleaner way I’m missing.
