Fi: Building with FLTK_BUILD_GL=0 fails on systems without opengl installed (#1151)

This commit is contained in:
ManoloFLTK
2024-12-03 17:12:49 +01:00
parent edd680395f
commit 167dba8817

View File

@@ -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 <FL/${hd}>\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 <FL/${hd}>\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