# New generator expression $\<TARGET\_RUNTIME\_DLL\_PATHS:tgt\> ?

**URL:** https://discourse.cmake.org/t/new-generator-expression-target-runtime-dll-paths-tgt/7426
**Category:** Development
**Created:** [February 7, 2023, 10:48pm UTC](https://discourse.cmake.org/t/new-generator-expression-target-runtime-dll-paths-tgt/7426 "2023-02-07T22:48:51Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![neundorf](https://discourse.cmake.org/user_avatar/discourse.cmake.org/neundorf/32/2075_2.png) [@neundorf](https://discourse.cmake.org/u/neundorf)
#### Post date: [February 7, 2023, 10:48pm UTC](https://discourse.cmake.org/t/new-generator-expression-target-runtime-dll-paths-tgt/7426/1 "2023-02-07T22:48:51Z")

</div>

Hi,

I’m thinking about adding a new generator expression to make it easier to collect the directory necessary to find all dlls, and to use it then e.g. to generate a bat file or to set the VS\_DEBUGGER\_ENVIRONMENT target property.  
[https://gitlab.kitware.com/neundorf/cmake/-/commit/388b6812acf8f93d7b0ecbd88551867c75ffd4b2](https://gitlab.kitware.com/neundorf/cmake/-/commit/388b6812acf8f93d7b0ecbd88551867c75ffd4b2)

What do you think ? Comments ?

Alex

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [February 8, 2023, 8:01pm UTC](https://discourse.cmake.org/t/new-generator-expression-target-runtime-dll-paths-tgt/7426/2 "2023-02-08T20:01:59Z")

</div>

Sure, I think that makes sense. It would be in a similar vain to the `$<TARGET_RUNTIME_DLLS>` genex.

---

<div class="post-metadata">

### Author: ![neundorf](https://discourse.cmake.org/user_avatar/discourse.cmake.org/neundorf/32/2075_2.png) [@neundorf](https://discourse.cmake.org/u/neundorf)
#### Post date: [February 8, 2023, 11:02pm UTC](https://discourse.cmake.org/t/new-generator-expression-target-runtime-dll-paths-tgt/7426/3 "2023-02-08T23:02:48Z")

</div>

Should I filter out some default directories, because they are searched anyway ? If yes, I guess there’s some cmake variable which contains those system directories ?

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [February 8, 2023, 11:04pm UTC](https://discourse.cmake.org/t/new-generator-expression-target-runtime-dll-paths-tgt/7426/4 "2023-02-08T23:04:50Z")

</div>

No, let’s just have it add the directory for every entry in `$<TARGET_RUNTIME_DLLS>`. Maybe we could filter out duplicates.

---

<div class="post-metadata">

### Author: ![neundorf](https://discourse.cmake.org/user_avatar/discourse.cmake.org/neundorf/32/2075_2.png) [@neundorf](https://discourse.cmake.org/u/neundorf)
#### Post date: [February 12, 2023, 10:23pm UTC](https://discourse.cmake.org/t/new-generator-expression-target-runtime-dll-paths-tgt/7426/5 "2023-02-12T22:23:47Z")

</div>

Ok, the code in the branch already skips duplicates.  
Is TARGET\_RUNTIME\_DLL\_PATHS a good name, or would TARGET\_RUNTIME\_DLL\_DIRS be better ?  
Or some other name ?

---

<div class="post-metadata">

### Author: ![maleike](https://discourse.cmake.org/user_avatar/discourse.cmake.org/maleike/32/3264_2.png) [@maleike](https://discourse.cmake.org/u/maleike)
#### Post date: [March 17, 2023, 10:27am UTC](https://discourse.cmake.org/t/new-generator-expression-target-runtime-dll-paths-tgt/7426/6 "2023-03-17T10:27:40Z")

</div>

Your suggestion is exactly what I was looking for reading up the generator expressions available to populate VS\_DEBUGGER\_ENVIRONMENT on test executables. 👏

Can’t wait to see this in a release!

(Regarding names, I like the suggested TARGET\_RUNTIME\_DLL\_PATHS)

---

<div class="post-metadata">

### Author: ![neundorf](https://discourse.cmake.org/user_avatar/discourse.cmake.org/neundorf/32/2075_2.png) [@neundorf](https://discourse.cmake.org/u/neundorf)
#### Post date: [March 17, 2023, 9:09pm UTC](https://discourse.cmake.org/t/new-generator-expression-target-runtime-dll-paths-tgt/7426/7 "2023-03-17T21:09:09Z")

</div>

It should be in 3.27, TARGET\_RUNTIME\_DLL\_DIRS.
