summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt16
1 files changed, 11 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 001f94088..d02059166 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,14 +28,20 @@
# Minimum CMake version required by FLTK 1.4 (06/2020, work in progress)
cmake_minimum_required (VERSION 3.2.3 FATAL_ERROR)
-# Use "legacy mode" of FindOpenGL (avoid CMake developer warning)
+#######################################################################
+
+# Use "legacy mode" of FindOpenGL (avoid CMake developer warning).
# Note: we're using FindOpenGL with `OPENGL_LIBRARIES` and not (yet)
-# the `OpenGL::GL` target. May be changed in the future.
+# the `OpenGL::GL` target. This may be changed in the future.
# See https://cmake.org/cmake/help/latest/policy/CMP0072.html
+# Update Feb 28, 2021: To avoid a warning about "OLD" policies we set
+# OpenGL_GL_PREFERENCE directly to "LEGACY" (other option: "GLVND").
-if (POLICY CMP0072)
- cmake_policy (SET CMP0072 OLD)
-endif ()
+# if (POLICY CMP0072)
+# cmake_policy (SET CMP0072 OLD)
+# endif ()
+
+set (OpenGL_GL_PREFERENCE LEGACY)
#######################################################################
# define the FLTK project and version