# CMake cannot find glfw on windows

**URL:** <https://discourse.glfw.org/t/cmake-cannot-find-glfw-on-windows/760>\
**Category:** support\
**Created:** [September 17, 2016, 5:17am UTC](https://discourse.glfw.org/t/cmake-cannot-find-glfw-on-windows/760 "2016-09-17T05:17:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lianera](https://avatars.discourse-cdn.com/v4/letter/l/8dc957/32.png) [@lianera](https://discourse.glfw.org/u/lianera)\
**Post date:** [September 17, 2016, 5:17am UTC](https://discourse.glfw.org/t/cmake-cannot-find-glfw-on-windows/760/1 "2016-09-17T05:17:20Z")

</div>

I have compiled glfw and installed at “C:\program files\GLFW”, it all works fine. Then I add “C:\Program Files\GLFW” to the system environment variable named glfw3\_DIR. But when I was add glfw to my own program by writing find\_package(glfw3 REQUIRED) in the CMakelists.txt, the cmake cannot find the header and library path of glfw, it can only find the root dir of glfw.  
More specifically, cmake only show 3 entry:  
CMAKE\_CONFIGURATION\_TYPES:Debug;Release;MinSizeRel;RelWithDebInfo  
CMAKE\_INSTALL\_PREFIX:C:/Program Files/TinyRenderer  
glfw3\_DIR:C:/Program Files/GLFW/lib/cmake/glfw3

There are no header path or lib path, so when I compile my program, it occurred an error:  
“GLFW/glfw3.h”: No such file or directory

I also noticed there is a glfw3.pc file at the glfw directory, however my cmake can’t use pkgconfig on windows.  
How to solve this problem?
