From 8369880b56e9cff1314a1334c489487acab7ddec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 25 May 2020 16:30:13 +0200 Subject: [PATCH] Only look for OSMesa module if building examples GLFW itself doesn't need the OSMesa headers to build. --- CMakeLists.txt | 7 ------- examples/CMakeLists.txt | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2462e9e9..b5755827 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,13 +260,6 @@ if (_GLFW_WAYLAND) endif() endif() -#-------------------------------------------------------------------- -# Use OSMesa for offscreen context creation -#-------------------------------------------------------------------- -if (_GLFW_OSMESA) - find_package(OSMesa REQUIRED) -endif() - #-------------------------------------------------------------------- # Use Cocoa for window creation and NSOpenGL for context creation #-------------------------------------------------------------------- diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 867f5bcf..87d0cbc8 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -48,6 +48,7 @@ set_target_properties(${GUI_ONLY_BINARIES} ${CONSOLE_BINARIES} PROPERTIES FOLDER "GLFW3/Examples") if (GLFW_USE_OSMESA) + find_package(OSMesa REQUIRED) target_compile_definitions(offscreen PRIVATE USE_NATIVE_OSMESA) endif()