From 167dba881733d8a8f43cfe047e1122512e5f878e Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:12:49 +0100 Subject: [PATCH] Fi: Building with FLTK_BUILD_GL=0 fails on systems without opengl installed (#1151) --- test/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a92d700a31..eff372154d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -245,11 +245,18 @@ if(CMAKE_CXX_COMPILER_ID IN_LIST _compilers) foreach(hd ${all_headers}) get_filename_component(hd "${hd}" NAME) # skip headers that must not be included directly and fl_config.h if it exists - string(REGEX MATCH "^(mac|win32|x11|wayland|fl_config)\.[hH]$" skip "${hd}") + string(REGEX MATCH "^(mac|win32|x11|wayland|fl_config|gl[a-z_0-9]*)\.[hH]$" skip "${hd}") if(skip STREQUAL "") file(APPEND ${include_all} "#include \n") endif() endforeach() + if(FLTK_USE_GL) + file(GLOB all_headers "${FLTK_SOURCE_DIR}/FL/gl*.[hH]") + foreach(hd ${all_headers}) + get_filename_component(hd "${hd}" NAME) + file(APPEND ${include_all} "#include \n") + endforeach() + endif(FLTK_USE_GL) file(APPEND ${include_all} "/* End of generated file */\n") # now add the 'shadow_variables' target and set the compiler flag