FLTK logo

[master] 266b5e7 - Fix CMake warning related to CMP0072

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 266b5e7 - Fix CMake warning related to CMP0072 "Albrecht Schlosser" Mar 01, 2021  
 
commit 266b5e7cddaaca312b77abd5696e0281af3251c9
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Sun Feb 28 14:56:56 2021 +0100
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Mon Mar 1 10:02:41 2021 +0100

    Fix CMake warning related to CMP0072

 CMakeLists.txt | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git CMakeLists.txt CMakeLists.txt
index 001f940..d020591 100644
--- CMakeLists.txt
+++ 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
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.