Linux; Test all OpenGL requirements during cmake stage, otherwise build will build later (sometimes as late as link stage).

master
Nicky 2022-02-08 20:20:52 +01:00
parent 8fb820099c
commit 539b7d46b3
1 changed files with 18 additions and 0 deletions

View File

@ -16,3 +16,21 @@ endif (BUILD_HEADLESS)
include(FindOpenGL)
if(LINUX)
if( NOT OPENGL_FOUND )
message( FATAL_ERROR "OpenGL not found, install mesa-common-dev libgl1-mesa-dev" )
endif()
find_file( GLUH "GL/glu.h" )
if( NOT GLUH )
message( FATAL_ERROR "GL/glu.h not found, install libglu1-mesa-dev" )
endif()
find_library( XINERAMA Xinerama )
if( NOT XINERAMA )
message( FATAL_ERROR "Cannot link with -lXinerame, install libxinerama-dev" )
endif()
find_library( XRANDR Xrandr)
if( NOT XRANDR )
message( FATAL_ERROR "Cannot link with -lXrandr, install libxrandr-dev" )
endif()
endif()