From 5416e347ad969081c78f160af4fc12d775fe696d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 23 May 2019 20:09:36 +0200 Subject: [PATCH] Enable CMake policy CMP0077 where available This will let higher-level projects override GLFW CMake options with normal variables instead of having to use cache variables. This means with CMake 3.13 and later you can now do: set(GLFW_BUILD_TESTS ON) add_subdirectory(path/to/glfw) Instead of the more verbose: set(GLFW_BUILD_TESTS ON CACHE BOOL "" FORCE) add_subdirectory(path/to/glfw) (cherry picked from commit 71e6ff386d9a3e0cc7c069be9b0ee1a9ac738647) --- CMakeLists.txt | 4 ++++ README.md | 1 + 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3af22e8..a07c9645 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,10 @@ if (POLICY CMP0054) cmake_policy(SET CMP0054 NEW) endif() +if (POLICY CMP0077) + cmake_policy(SET CMP0077 NEW) +endif() + set_property(GLOBAL PROPERTY USE_FOLDERS ON) option(BUILD_SHARED_LIBS "Build shared libraries" OFF) diff --git a/README.md b/README.md index 6ac3d6b4..a9e9b8e6 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,7 @@ skills. - Robin Leffmann - Glenn Lewis - Shane Liesegang + - Anders Lindqvist - Eyal Lotem - Aaron Loucks - Tristam MacDonald