The build system does not seem to consistently respect non-default options. Fix that in the patch. The following forces X11 on Apple and fixes linking. --- CMakeLists.txt.orig 2024-11-25 00:01:28 +++ CMakeLists.txt 2024-11-26 18:50:58 @@ -15,6 +15,8 @@ if (APPLE) include(vtkApple) + set(VTK_USE_COCOA OFF FORCE) + set(VTK_USE_X ON FORCE) endif () if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # For VTK 9.4.0: It looks like upstream already fixed previous hunk #1 # "elseif (VTK_USE_SDL2)". Remove hunk #1, leave hunk #2 in place. --- Rendering/OpenGL2/CMakeLists.txt.orig 2024-11-25 00:01:28 +++ Rendering/OpenGL2/CMakeLists.txt 2024-11-26 18:50:58 @@ -438,6 +438,7 @@ if (VTK_USE_X) vtk_module_find_package(PACKAGE X11) vtk_module_link(VTK::RenderingOpenGL2 PUBLIC X11::X11) + vtk_module_link(VTK::RenderingOpenGL2 PUBLIC GL) if (TARGET X11::Xcursor) vtk_module_link(VTK::RenderingOpenGL2 PRIVATE X11::Xcursor) else() --- CMake/vtkOpenGLOptions.cmake.orig 2024-11-25 00:01:28 +++ CMake/vtkOpenGLOptions.cmake 2024-11-26 18:50:58 @@ -8,12 +8,12 @@ include(CMakeDependentOption) # For each platform specific API, we define VTK_USE_ options. -cmake_dependent_option(VTK_USE_COCOA "Use Cocoa for VTK render windows" ON - "APPLE;NOT APPLE_IOS" OFF) +set(default_use_cocoa OFF) +option(VTK_USE_COCOA "Use Cocoa for VTK render windows" "${default_use_cocoa}") mark_as_advanced(VTK_USE_COCOA) set(default_use_x OFF) -if(UNIX AND NOT ANDROID AND NOT APPLE AND NOT APPLE_IOS AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") +if(UNIX AND NOT ANDROID AND NOT APPLE_IOS AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") set(default_use_x ON) endif() option(VTK_USE_X "Use X for VTK render windows" "${default_use_x}")