[master] caf0bfa - Avoid CMake developer warning related to OpenGL/CMP0072
"Albrecht Schlosser"
Sep 18, 2020
commit caf0bfa81d1924e84391a1cccbceefa4cc87f880
Author: Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Fri Sep 18 18:07:18 2020 +0200
Commit: Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Fri Sep 18 18:07:18 2020 +0200
Avoid CMake developer warning related to OpenGL/CMP0072
Newer CMake versions warn if CMake policy CMP0072 is not set. We're
using "legacy mode" since we use FindOpenGL with `OPENGL_LIBRARIES`
and not (yet) the `OpenGL::GL` target.
See https://cmake.org/cmake/help/latest/policy/CMP0072.html
CMakeLists.txt | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git CMakeLists.txt CMakeLists.txt
index 9693b67..191d0cf 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -28,6 +28,15 @@
# 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)
+# Note: we're using FindOpenGL with `OPENGL_LIBRARIES` and not (yet)
+# the `OpenGL::GL` target. May be changed in the future.
+# See https://cmake.org/cmake/help/latest/policy/CMP0072.html
+
+if (POLICY CMP0072)
+ cmake_policy (SET CMP0072 OLD)
+endif ()
+
#######################################################################
# define the FLTK project and version
#######################################################################
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.