# Does the IMPORTED\_LOCATION property support generator expressions?

**URL:** https://discourse.cmake.org/t/does-the-imported-location-property-support-generator-expressions/5730
**Category:** Usage
**Created:** [May 25, 2022, 6:31pm UTC](https://discourse.cmake.org/t/does-the-imported-location-property-support-generator-expressions/5730 "2022-05-25T18:31:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![JRR](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/ecccb3/32.png) [@JRR](https://discourse.cmake.org/u/JRR)
#### Post date: [May 25, 2022, 6:31pm UTC](https://discourse.cmake.org/t/does-the-imported-location-property-support-generator-expressions/5730/1 "2022-05-25T18:31:46Z")

</div>

Does the `IMPORTED_LOCATION` target property support generator expressions?

I tried this with and it appears to work on Windows but not on Linux. I don’t see an explicit “this supports generator expressions” notice, but I was thinking since it works with Windows it would work with Linux too.

---

<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 25, 2022, 6:46pm UTC](https://discourse.cmake.org/t/does-the-imported-location-property-support-generator-expressions/5730/2 "2022-05-25T18:46:07Z")

</div>

When you say “Windows” do you mean the Visual Studio generator? If so, does it work with the Ninja generator on Windows? I ask because I suspect this is actually generator-divergent behavior rather than platform-based. Please file [an issue](https://gitlab.kitware.com/cmake/cmake/-/issues) with your findings since something needs changed anyways to make it consistent however it shakes out (with test cases of course).

---

<div class="post-metadata">

### Author: ![JRR](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/ecccb3/32.png) [@JRR](https://discourse.cmake.org/u/JRR)
#### Post date: [May 25, 2022, 6:48pm UTC](https://discourse.cmake.org/t/does-the-imported-location-property-support-generator-expressions/5730/3 "2022-05-25T18:48:58Z")

</div>

Oh! Thanks @ben.boeckel ! I forget that Windows != Visual Studio.

Yes, this was found in Visual Studio.

I was so excited, I thought I had a working solution using the generator expression for `IMPORTED_LOCATION` based on my Windows Visual Studio test, but then it failed on my Linux tests.

I will see about creating a simple example to prove and file an issue as suggested.

---

<div class="post-metadata">

### Author: ![JRR](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/ecccb3/32.png) [@JRR](https://discourse.cmake.org/u/JRR)
#### Post date: [June 1, 2022, 6:59pm UTC](https://discourse.cmake.org/t/does-the-imported-location-property-support-generator-expressions/5730/4 "2022-06-01T18:59:48Z")

</div>

I learned that it’s not a problem. I was using the contents of IMPORTED\_LOCATION to be passed to another option that accepted Generator expressions.

This worked for one case in VS but not for it’s true purpose. In short… this is an operator error.
