summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-09-18 18:07:18 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-09-18 18:07:18 +0200
commitcaf0bfa81d1924e84391a1cccbceefa4cc87f880 (patch)
tree5394f4dfec557043dc2210567af9d095a123f918 /CMakeLists.txt
parent360040d0bff21f13ed36637810c8bdf71b4abf5a (diff)
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
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9693b673e..191d0cf42 100644
--- a/CMakeLists.txt
+++ b/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
#######################################################################