GLFW_STANDALONE check to disable examples and tests if building as submodule in v3.3.8?

Hi everyone,

I noticed that back in May 2019 commit 8ee589e was added that introduced a mechanism to detect whether GLFW was being included as a subproject and if so disabled the build options for the examples and tests. However, looking at the root CMakeLists.txt in the latest release v3.3.8 which is tied to commit 7482de6 made last year, it seems like that commit was either removed or never included in the first place (the GLFW_BUILD_EXAMPLES and GLFW_BUILD_TESTS options are now both hardcoded to ON).

Does anyone know what happened? Did they decide not to include the commit after all, or is it just awaiting release into the next version? If it’s the first case, I’d prefer to have this change be left in as it doesn’t break backward compatibility, and I’m using GLFW as a subproject and would rather not have to waste the time and space to build a bunch of unnecessary tests and examples.

If anyone could help, that would be great.
Thank you!

Hi @Vbbab,

Welcome to the GLFW forum.

GLFW_STANDALONE is available in the latest GLFW code from GitHub, but has not yet been included in a release.

If you are not using the code direct from GitHub, you can turn off building the tests and examples using:

set( GLFW_BUILD_EXAMPLES OFF CACHE BOOL  "GLFW lib only" )
set( GLFW_BUILD_TESTS OFF CACHE BOOL  "GLFW lib only" )
set( GLFW_BUILD_DOCS OFF CACHE BOOL  "GLFW lib only" )
set( GLFW_BUILD_INSTALL OFF CACHE BOOL  "GLFW lib only" )

Alright, I see now. Thank you!