Skip to content

Commit

Permalink
[CMake] Require asimage=ON in case of opengl=ON
Browse files Browse the repository at this point in the history
The opengl flag enables the graf3d features that depend on OpenGL, and
these features also depend on asimage. Therefore, the configuration
should fail if `asimage` is OFF and `opengl` is ON.

An alternative would have been to automatically enable `asimage` then,
but `asimage=ON` is already the default. So if it's actually off, it's
probably set to OFF by the user with some intention, and we better raise
awareness about this inconsistency with a configuration error.

Closes #16250.
  • Loading branch information
guitargeek committed Oct 9, 2024
1 parent 244161d commit a4ee33c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmake/modules/SearchInstalledSoftware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,12 @@ if(NOT WIN32 AND NOT APPLE)
set(opengl OFF CACHE BOOL "OpenGL requires x11" FORCE)
endif()
endif()
# The opengl flag enables the graf3d features that depend on OpenGL, and these
# features also depend on asimage. Therefore, the configuration will fail if
# asimage is off. See also: https://github.com/root-project/root/issues/16250
if(opengl AND NOT asimage)
message(FATAL_ERROR "OpenGL features enabled with \"opengl=ON\" require \"asimage=ON\"")
endif()

#---Check for GLEW -------------------------------------------------------------------
# Glew is required by various graf3d features that are enabled with opengl=ON,
Expand Down

0 comments on commit a4ee33c

Please sign in to comment.