From db76abb63c257a45a04cbfa9810c3b1692990510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 9 Dec 2019 17:04:34 +0100 Subject: [PATCH] Make target-specific define target-specific --- examples/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 0b976815..ce3e8c08 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -11,10 +11,6 @@ if (MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif() -if (GLFW_USE_OSMESA) - add_definitions(-DUSE_NATIVE_OSMESA) -endif() - if (WIN32) set(ICON glfw.rc) elseif (APPLE) @@ -63,6 +59,10 @@ set(CONSOLE_BINARIES offscreen) set_target_properties(${GUI_ONLY_BINARIES} ${CONSOLE_BINARIES} PROPERTIES FOLDER "GLFW3/Examples") +if (GLFW_USE_OSMESA) + target_compile_definitions(offscreen PRIVATE USE_NATIVE_OSMESA) +endif() + if (MSVC) # Tell MSVC to use main instead of WinMain for Windows subsystem executables set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES