From e5601f1619a6f1516cec504fe9d1d200510d666a Mon Sep 17 00:00:00 2001 From: "m@bitsnbites.eu" Date: Mon, 1 Feb 2016 10:34:10 +0100 Subject: [PATCH] Add GLFW includes to target_include_directories This makes it easier to build GLFW as a sub-project of another CMake based project. Instead of having to use include_directories(path/to/glfw/include) the project using GLFW will get the correct include path by just doing target_link_libraries(myapp glfw ${GLFW_LIBRARIES}). --- src/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 590a10f8e..93494952c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -64,6 +64,9 @@ target_include_directories(glfw PRIVATE "${GLFW_BINARY_DIR}/src" ${glfw_INCLUDE_DIRS}) +# Make the public GLFW includes available for users of the GLFW library. +target_include_directories(glfw PUBLIC "${GLFW_SOURCE_DIR}/include") + # HACK: When building on MinGW, WINVER and UNICODE need to be defined before # the inclusion of stddef.h (by glfw3.h), which is itself included before # win32_platform.h. We define them here until a saner solution can be found