# OpenGL cmake linmath.h no such file or directory

**URL:** <https://discourse.glfw.org/t/opengl-cmake-linmath-h-no-such-file-or-directory/1748>\
**Category:** support\
**Created:** [January 17, 2021, 1:16am UTC](https://discourse.glfw.org/t/opengl-cmake-linmath-h-no-such-file-or-directory/1748 "2021-01-17T01:16:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mimams](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@mimams](https://discourse.glfw.org/u/mimams)\
**Post date:** [January 17, 2021, 1:16am UTC](https://discourse.glfw.org/t/opengl-cmake-linmath-h-no-such-file-or-directory/1748/1 "2021-01-17T01:16:42Z")

</div>

Hello everyone!  
I’m using cmake with glfw, but when I write “make” it doesn’t work.  
This is my CMakeLists.txt

```auto
CMAKE_MINIMUM_REQUIRED(VERSION 3.7)
PROJECT(project)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_BUILD_TYPE DEBUG)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(/home/andrey/Downloads/glfw /home/andrey/Downloads/glfw/src)
SET(SOURCE_FILES test.cpp)
ADD_EXECUTABLE(project ${SOURCE_FILES})
target_link_libraries(project glfw)
find_package(OpenGL REQUIRED)
target_link_libraries(project OpenGL::GL)

```

I used this tutorial to make the CMakeLists.txt above: [GLFW: Building applications](https://www.glfw.org/docs/latest/build_guide.html#build_link_cmake_source)

---

<div class="post-metadata">

**Author:** ![mmozeiko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/mmozeiko/32/29_2.png) [@mmozeiko](https://discourse.glfw.org/u/mmozeiko)\
**Post date:** [January 17, 2021, 2:06am UTC](https://discourse.glfw.org/t/opengl-cmake-linmath-h-no-such-file-or-directory/1748/2 "2021-01-17T02:06:24Z")

</div>

linmath.h is not part of glfw build. It is external dependency use in some of glfw examples.

You can get latest version of linmath.h from [https://github.com/datenwolf/linmath.h](https://github.com/datenwolf/linmath.h) repository.

If you want to use it in your code, then you need to either copy it next to your source file, or add appropriate include directories to your cmake script.

For including glfw cmake script you should just disable building of examples & tests. See here: [https://www.glfw.org/docs/latest/build\_guide.html#build\_link\_cmake\_source](https://www.glfw.org/docs/latest/build_guide.html#build_link_cmake_source)

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [January 17, 2021, 3:30pm UTC](https://discourse.glfw.org/t/opengl-cmake-linmath-h-no-such-file-or-directory/1748/3 "2021-01-17T15:30:28Z")

</div>

There’s a simple example of using GLFW with CMake here:

> **[juliettef/GLFW-CMake-starter](https://github.com/juliettef/GLFW-CMake-starter)**
>
> Use CMake to create a project with GLFW - Multi-platform Windows, Linux and MacOS.
