Skip to content

Commit

Permalink
Enable CMake policy CMP0077 where available
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
elmindreda committed May 24, 2019
1 parent 98dde03 commit 71e6ff3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ skills.
- Robin Leffmann
- Glenn Lewis
- Shane Liesegang
- Anders Lindqvist
- Eyal Lotem
- Aaron Loucks
- Tristam MacDonald
Expand Down

0 comments on commit 71e6ff3

Please sign in to comment.