--- src/slic3r/CMakeLists.txt.orig	2026-03-22 17:56:38 UTC
+++ src/slic3r/CMakeLists.txt
@@ -760,6 +760,15 @@ elseif (APPLE)
     else()
         target_link_libraries(libslic3r_gui ${DISKARBITRATION_LIBRARY} "-framework Security")
     endif()
+elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+    find_package(PkgConfig REQUIRED)
+    pkg_check_modules(DBUS REQUIRED dbus-1)
+    find_package(CURL REQUIRED)
+    target_include_directories(libslic3r_gui SYSTEM PRIVATE ${DBUS_INCLUDE_DIRS})
+    target_link_libraries(libslic3r_gui
+        ${DBUS_LIBRARIES}
+        ${CURL_LIBRARIES}
+    )
 endif()
 
 if (SLIC3R_STATIC)
@@ -770,6 +779,8 @@ if (SPNAV_LIB)
 
 if (SPNAV_LIB)
     target_link_libraries(libslic3r_gui ${SPNAV_LIB})
+    find_package(X11 REQUIRED)
+    target_link_libraries(libslic3r_gui ${SPNAV_LIB} ${X11_LIBRARIES})
 endif()
 
 if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_CURL AND UNIX AND NOT APPLE)
@@ -787,6 +798,8 @@ if (UNIX AND NOT APPLE)
     find_package(PkgConfig REQUIRED)
     find_package(GTK${SLIC3R_GTK} REQUIRED)
     pkg_check_modules(LIBSECRET REQUIRED libsecret-1)
+    pkg_check_modules(webkit2gtk REQUIRED webkit2gtk-4.1)
+    target_link_libraries (libslic3r_gui ${X11_LIBRARIES} ${webkit2gtk_LIBRARIES})
     if (FLATPAK)
         # I don't know why this is needed, but for whatever reason slic3r isn't
         # linking to X11 and webkit2gtk. force it.
