Skip to content

Commit

Permalink
[CMake] Require opengl when building with cocoa
Browse files Browse the repository at this point in the history
Closes root-project#7160, as discussed in the issue thread.
  • Loading branch information
guitargeek authored and kristupaspranc committed May 21, 2024
1 parent ad9428d commit f60727f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmake/modules/SearchInstalledSoftware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ if(cocoa)
if(APPLE)
set(x11 OFF CACHE BOOL "Disabled because cocoa requested (${x11_description})" FORCE)
set(builtin_freetype ON CACHE BOOL "Enabled because needed for Cocoa graphics (${builtin_freetype_description})" FORCE)
if(NOT opengl)
message(FATAL_ERROR "Option \"cocoa=ON\" requires \"opengl=ON\"!")
endif()
else()
message(STATUS "Cocoa option can only be enabled on MacOSX platform")
set(cocoa OFF CACHE BOOL "Disabled because only available on MacOSX (${cocoa_description})" FORCE)
Expand Down Expand Up @@ -549,6 +552,8 @@ if(opengl)
if(NOT OPENGL_FOUND OR NOT OPENGL_GLU_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "OpenGL package (with GLU) not found and opengl option required")
elseif(cocoa)
message(FATAL_ERROR "OpenGL package (with GLU) not found and opengl option required for \"cocoa=ON\"")
else()
message(STATUS "OpenGL (with GLU) not found. Switching off opengl option")
set(opengl OFF CACHE BOOL "Disabled because OpenGL (with GLU) not found (${opengl_description})" FORCE)
Expand Down

0 comments on commit f60727f

Please sign in to comment.