Disable examples and tests when a subproject

This changes the default value of the GLFW_BUILD_EXAMPLES and
GLFW_BUILD_TESTS CMake options to false when GLFW is being added as
a subdirectory by another CMake project.

If you want the previous behavior, force these options to true before
adding the GLFW subdirectory:

set(GLFW_BUILD_EXAMPLES ON CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS ON CACHE BOOL "" FORCE)
add_subdirectory(path/to/glfw)

Doing this is backward compatible with earlier versions of GLFW.

The GLFW_BUILD_DOCS option is left enabled as it also requires Doxygen
to have any effect, is quicker to build and is more likely to be useful
when GLFW is a subproject.
This commit is contained in:
Camilla Löwy
2019-05-08 19:04:21 +02:00
parent cd290f767f
commit 8ee589e43b
5 changed files with 27 additions and 16 deletions
+1
View File
@@ -118,6 +118,7 @@ information on what to include when reporting a bug.
## Changelog
- Disabled tests and examples by default when built as a CMake subdirectory
- Bugfix: The CMake config-file package used an absolute path and was not
relocatable (#1470)
- [X11] Bugfix: The CMake files did not check for the XInput headers (#1480)