# Find WindowsSDK library (SetupApi)

**URL:** https://discourse.cmake.org/t/find-windowssdk-library-setupapi/906
**Category:** Usage
**Tags:** os:windows, comp:msvc
**Created:** [April 1, 2020, 11:17am UTC](https://discourse.cmake.org/t/find-windowssdk-library-setupapi/906 "2020-04-01T11:17:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zakalawe](https://discourse.cmake.org/user_avatar/discourse.cmake.org/zakalawe/32/508_2.png) [@zakalawe](https://discourse.cmake.org/u/zakalawe)
#### Post date: [April 1, 2020, 11:17am UTC](https://discourse.cmake.org/t/find-windowssdk-library-setupapi/906/1 "2020-04-01T11:17:12Z")

</div>

Is there an official way to ensure that the active Windows SDK library path is searched by find\_library()? I can find via Google various 3rdparty CMake files, but hoped there might be a recommend best practice?

Eg on my system, the SDK is at C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x64 - but this obviously depends on architecture, and when a new SDK is released the path will change. The scripts I’ve found lookup a registry key to find the active path, but I was hoping the VisualStudio environment / compiler would already have the path added?

---

<div class="post-metadata">

### Author: ![bvanevery](https://discourse.cmake.org/user_avatar/discourse.cmake.org/bvanevery/32/559_2.png) [@bvanevery](https://discourse.cmake.org/u/bvanevery)
#### Post date: [April 28, 2020, 3:56am UTC](https://discourse.cmake.org/t/find-windowssdk-library-setupapi/906/2 "2020-04-28T03:56:44Z")

</div>

> [@zakalawe](#):
>
> and when a new SDK is released the path will change

No it won’t. In VS of recent years, the targeted SDK is a property of the VS project file. You can’t have a SDK “change out from under you” like in the old days.

---

<div class="post-metadata">

### Author: ![zakalawe](https://discourse.cmake.org/user_avatar/discourse.cmake.org/zakalawe/32/508_2.png) [@zakalawe](https://discourse.cmake.org/u/zakalawe)
#### Post date: [April 28, 2020, 7:32am UTC](https://discourse.cmake.org/t/find-windowssdk-library-setupapi/906/3 "2020-04-28T07:32:25Z")

</div>

Ah, good to know. I actually managed to skip around this problem, but still useful to understand a bit more.
