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 71e6ff386d)
This commit is contained in:
Camilla Löwy 2019-05-23 20:09:36 +02:00
parent 16186943b4
commit 5416e347ad
2 changed files with 5 additions and 0 deletions

View File

@ -8,6 +8,10 @@ if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW) cmake_policy(SET CMP0054 NEW)
endif() endif()
if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF) option(BUILD_SHARED_LIBS "Build shared libraries" OFF)

View File

@ -220,6 +220,7 @@ skills.
- Robin Leffmann - Robin Leffmann
- Glenn Lewis - Glenn Lewis
- Shane Liesegang - Shane Liesegang
- Anders Lindqvist
- Eyal Lotem - Eyal Lotem
- Aaron Loucks - Aaron Loucks
- Tristam MacDonald - Tristam MacDonald