Index: CMakeLists.txt
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -527,10 +527,10 @@ else()
   target_link_libraries(svg PUBLIC Eigen3::Eigen)
   message(STATUS "Eigen: ${Eigen3_VERSION}")
 
-  find_package(Boost 1.70 REQUIRED QUIET COMPONENTS regex program_options)
+  find_package(Boost 1.70 REQUIRED QUIET COMPONENTS filesystem regex program_options)
   message(STATUS "Boost: ${Boost_VERSION}")
   target_compile_definitions(OpenSCADLibInternal PRIVATE BOOST_DLL_USE_STD_FS)
-  target_link_libraries(OpenSCADLibInternal PUBLIC Boost::headers Boost::regex Boost::program_options)
+  target_link_libraries(OpenSCADLibInternal PUBLIC Boost::headers Boost::regex Boost::program_options Boost::filesystem)
   target_link_libraries(svg PUBLIC Boost::headers)
 
   find_package(HarfBuzz 0.9.19 REQUIRED QUIET)
@@ -693,7 +693,7 @@ if(ENABLE_CAIRO STREQUAL "AUTO")
   if(CAIRO_VERSION OR CAIRO_FOUND)
     message(STATUS "Cairo: ${CAIRO_VERSION}")
     target_include_directories(OpenSCADLibInternal SYSTEM PUBLIC ${CAIRO_INCLUDE_DIRS})
-    target_link_libraries(OpenSCADLibInternal PUBLIC ${CAIRO_LIBRARIES})
+    target_link_libraries(OpenSCADLibInternal PUBLIC ${CAIRO_LINK_LIBRARIES})
     target_compile_definitions(OpenSCADLibInternal PUBLIC ENABLE_CAIRO)
   else()
     message(STATUS "Cairo: disabled (not found)")
@@ -957,7 +957,7 @@ elseif(UNIX)
       if (NOT USE_GLAD)
         target_compile_definitions(OpenSCADLibInternal PUBLIC GLEW_EGL)
       endif()
-      target_link_libraries(OpenSCADLibInternal PUBLIC OpenGL::EGL)
+      target_link_libraries(OpenSCADLibInternal PUBLIC ${OPENGL_egl_LIBRARY})
     endif()
     if(ENABLE_GLX AND OpenGL_GLX_FOUND)
       target_compile_definitions(OpenSCADLibInternal PUBLIC ENABLE_GLX)
@@ -1260,11 +1260,6 @@ else()
     ${GLEW_SOURCES})
 endif()
 
-
-if(UNIX AND (NOT APPLE) AND (NOT HEADLESS))
-  set(PLATFORM_INPUT_DRIVER_SOURCES src/gui/input/JoystickInputDriver.cc)
-  target_compile_definitions(OpenSCADLibInternal PUBLIC ENABLE_JOYSTICK)
-endif()
 
 set(INPUT_DRIVER_SOURCES
   ${PLATFORM_INPUT_DRIVER_SOURCES}
