3D connexion support on Linux:
- Replace hidapi/linux/hid.c with the hidraw variant (link to udev) - Add CMakeLists.txt for hidapi, refactor - Add udev rules file (no installation so far)
This commit is contained in:
parent
1aa559585c
commit
82fed1790a
@ -365,25 +365,6 @@ include_directories(${GLEW_INCLUDE_DIRS})
|
|||||||
add_library(cereal INTERFACE)
|
add_library(cereal INTERFACE)
|
||||||
target_include_directories(cereal INTERFACE include)
|
target_include_directories(cereal INTERFACE include)
|
||||||
|
|
||||||
# Find the hidapi library
|
|
||||||
if(WIN32)
|
|
||||||
add_library(hidapi STATIC
|
|
||||||
${LIBDIR}/hidapi/win/hid.c
|
|
||||||
)
|
|
||||||
elseif (APPLE)
|
|
||||||
add_library(hidapi STATIC
|
|
||||||
${LIBDIR}/hidapi/mac/hid.c
|
|
||||||
)
|
|
||||||
else ()
|
|
||||||
add_library(hidapi STATIC
|
|
||||||
${LIBDIR}/hidapi/linux/hid.c
|
|
||||||
)
|
|
||||||
endif ()
|
|
||||||
set(HIDAPI_FOUND 1)
|
|
||||||
set(HIDAPI_INCLUDE_DIRS ${LIBDIR}/hidapi/)
|
|
||||||
set(HIDAPI_LIBRARIES hidapi)
|
|
||||||
include_directories(${HIDAPI_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
# l10n
|
# l10n
|
||||||
set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/localization")
|
set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/localization")
|
||||||
add_custom_target(pot
|
add_custom_target(pot
|
||||||
|
23
resources/udev/90-3dconnexion.rules
Normal file
23
resources/udev/90-3dconnexion.rules
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# See src/slic3r/GUI/Mouse3DController.cpp for the list of devices
|
||||||
|
|
||||||
|
# Logitech vendor devices
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c623", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c626", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c628", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c627", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c603", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c62b", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c621", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c625", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c629", MODE="0666"
|
||||||
|
|
||||||
|
# 3D Connexion vendor devices
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256f", ATTRS{idProduct}=="c623", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256f", ATTRS{idProduct}=="c626", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256f", ATTRS{idProduct}=="c628", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256f", ATTRS{idProduct}=="c627", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256f", ATTRS{idProduct}=="c603", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256f", ATTRS{idProduct}=="c62b", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256f", ATTRS{idProduct}=="c621", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256f", ATTRS{idProduct}=="c625", MODE="0666"
|
||||||
|
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256f", ATTRS{idProduct}=="c629", MODE="0666"
|
@ -14,6 +14,7 @@ add_subdirectory(qhull)
|
|||||||
add_subdirectory(Shiny)
|
add_subdirectory(Shiny)
|
||||||
add_subdirectory(semver)
|
add_subdirectory(semver)
|
||||||
add_subdirectory(libigl)
|
add_subdirectory(libigl)
|
||||||
|
add_subdirectory(hidapi)
|
||||||
|
|
||||||
# Adding libnest2d project for bin packing...
|
# Adding libnest2d project for bin packing...
|
||||||
set(LIBNEST2D_UNITTESTS ON CACHE BOOL "Force generating unittests for libnest2d")
|
set(LIBNEST2D_UNITTESTS ON CACHE BOOL "Force generating unittests for libnest2d")
|
||||||
|
17
src/hidapi/CMakeLists.txt
Normal file
17
src/hidapi/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
set(HIDAPI_IMPL win/hid.c)
|
||||||
|
elseif (APPLE)
|
||||||
|
set(HIDAPI_IMPL mac/hid.c)
|
||||||
|
else ()
|
||||||
|
# Assume Linux or Unix other than Mac OS
|
||||||
|
set(HIDAPI_IMPL linux/hid.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include_directories(include)
|
||||||
|
|
||||||
|
add_library(hidapi STATIC ${HIDAPI_IMPL})
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
target_link_libraries(hidapi udev)
|
||||||
|
endif()
|
File diff suppressed because it is too large
Load Diff
@ -169,7 +169,7 @@ add_library(libslic3r_gui STATIC ${SLIC3R_GUI_SOURCES})
|
|||||||
|
|
||||||
encoding_check(libslic3r_gui)
|
encoding_check(libslic3r_gui)
|
||||||
|
|
||||||
target_link_libraries(libslic3r_gui libslic3r avrdude cereal imgui ${GLEW_LIBRARIES} ${HIDAPI_LIBRARIES})
|
target_link_libraries(libslic3r_gui libslic3r avrdude cereal imgui ${GLEW_LIBRARIES} hidapi)
|
||||||
if (SLIC3R_PCH AND NOT SLIC3R_SYNTAXONLY)
|
if (SLIC3R_PCH AND NOT SLIC3R_SYNTAXONLY)
|
||||||
add_precompiled_header(libslic3r_gui pchheader.hpp FORCEINCLUDE)
|
add_precompiled_header(libslic3r_gui pchheader.hpp FORCEINCLUDE)
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
#include <wx/glcanvas.h>
|
#include <wx/glcanvas.h>
|
||||||
|
|
||||||
|
// WARN: If updating these lists, please also update resources/udev/90-3dconnexion.rules
|
||||||
|
|
||||||
static const std::vector<int> _3DCONNEXION_VENDORS =
|
static const std::vector<int> _3DCONNEXION_VENDORS =
|
||||||
{
|
{
|
||||||
0x046d, // LOGITECH = 1133 // Logitech (3Dconnexion is made by Logitech)
|
0x046d, // LOGITECH = 1133 // Logitech (3Dconnexion is made by Logitech)
|
||||||
|
Loading…
Reference in New Issue
Block a user