$NetBSD$

Use libhidapi from pkgsrc.
Allow use of stable track wxWidgets on NetBSD.
Use namespaces to link against libcereal >= 1.3.1 from:
https://github.com/prusa3d/PrusaSlicer/commit/0ffcfd8393457fd035576436752267c9a1e6bbcc

--- src/CMakeLists.txt.orig	2022-08-19 14:41:23.000000000 +0000
+++ src/CMakeLists.txt
@@ -24,8 +24,6 @@ endif ()
 
 if (SLIC3R_GUI)
     add_subdirectory(imgui)
-    add_subdirectory(hidapi)
-    include_directories(hidapi/include)
 
     if(WIN32)
         message(STATUS "WXWIN environment set to: $ENV{WXWIN}")
@@ -38,10 +36,10 @@ if (SLIC3R_GUI)
         endif()
     endif()
 
-    if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
-        set (wxWidgets_CONFIG_OPTIONS "--toolkit=gtk${SLIC3R_GTK}")
+    if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
+        # set (wxWidgets_CONFIG_OPTIONS "--toolkit=gtk${SLIC3R_GTK}")
         if (SLIC3R_WX_STABLE)
-            find_package(wxWidgets 3.0 REQUIRED COMPONENTS base core adv html gl)
+            find_package(wxWidgets 3.0 QUIET COMPONENTS base core adv html gl)
         else ()
             find_package(wxWidgets 3.1 QUIET COMPONENTS base core adv html gl)
 
@@ -127,7 +125,7 @@ if (NOT WIN32 AND NOT APPLE)
     set_target_properties(PrusaSlicer PROPERTIES OUTPUT_NAME "prusa-slicer")
 endif ()
 
-target_link_libraries(PrusaSlicer libslic3r cereal)
+target_link_libraries(PrusaSlicer libslic3r cereal::cereal)
 
 if (APPLE)
 #    add_compile_options(-stdlib=libc++)
