# target\_link\_directories for imported targets

**URL:** https://discourse.cmake.org/t/target-link-directories-for-imported-targets/717
**Category:** Usage
**Tags:** os:windows, comp:msvc
**Created:** [February 27, 2020, 3:04pm UTC](https://discourse.cmake.org/t/target-link-directories-for-imported-targets/717 "2020-02-27T15:04:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sghosh](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/9de053/32.png) [@sghosh](https://discourse.cmake.org/u/sghosh)
#### Post date: [February 27, 2020, 3:04pm UTC](https://discourse.cmake.org/t/target-link-directories-for-imported-targets/717/1 "2020-02-27T15:04:20Z")

</div>

In my project I am using `MAP_IMPORTED_CONFIG_FINAL` for an external library for a custom configuration `FINAL` . Is there some working example of how to set the `target_link_directories` for an imported target for the custom configuration `FINAL` using cmake.

So here are the steps :

1. The external library is boost-1.67.0 which I am installing using the following commands for Debug and Release respectively:

```auto
.\bootstrap.bat

```

```auto
.\b2 install --prefix=C:\Dev\third-party\vs2017\boost-1.67.0\Debug toolset=msvc-14.1 address-model=64 link=static -j8 variant=debug

```

```auto
.\b2 install --prefix=C:\Dev\third-party\vs2017\boost-1.67.0\Release toolset=msvc-14.1 address-model=64 link=static -j8 variant=release

```

1. Here is the example project with following structure

```auto
boost-example/
 |
 +-- main.cpp
 |    
 +-- CMakeLists.txt
 | 
 |    
 +-- CMake/
 | |  
 | +-- AddConfiguration.cmake
 | +-- mpIncludeBoost.cmake
 | +-- mpSetupMSVCRuntime.cmake
 | +-- SetupConfigurations.cmake

```

The files are found in this gitlab project: [https://gitlab.com/sunayanag/boost-example](https://gitlab.com/sunayanag/boost-example).

For the sln file generated note that in Visual Studio in the `Linker` section in `Additional Library Directories` I get `C:/Dev/third-party/boost-1_67_0/install/lib/$(Configuration)` which evaluates to `C:/Dev/third-party/boost-1_67_0/install/lib/Final` but this directory does not exist since Final is not a valid configuration of boost, it should be `C:/Dev/third-party/boost-1_67_0/install/lib/Release` instead.

I was thinking a way of getting around this would be to use `target_link_directories` but how do I use this with cmake generator expressions in this case.

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: [February 28, 2020, 8:46pm UTC](https://discourse.cmake.org/t/target-link-directories-for-imported-targets/717/2 "2020-02-28T20:46:38Z")

</div>

It seems like your `Final` custom configuration type is not working here. I don’t know if it’s that not all of the bridges in the configuration mapping is done or not.

What are the values of `Boost_INCLUDE_DIRS` and `Boost_LIBRARY_DIRS`? I suspect that neither is needed since you’re using imported targets anyways.
