diff --git a/.gitignore b/.gitignore index aac3a37..4c7a321 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ # hvlusb +# Files generated by cmake +build/ + # # NOTE! Don't add files that are generated in specific # subdirectories here. Add them in the ".gitignore" file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..bfce6f1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.10) +project(hanvon-linux C) +add_executable(hvlusb hanvon-libusb.c) + +find_package(PkgConfig) +pkg_check_modules(LIBUSB REQUIRED libusb-1.0) +pkg_check_modules(LIBEVDEV REQUIRED libevdev) +#pkg_check_modules(LIBUDEV REQUIRED libudev) + +include_directories( + ${LIBUSB_INCLUDE_DIRS} + ${LIBEVDEV_INCLUDE_DIRS} +# ${LIBUDEV_INCLUDE_DIRS} +) +target_link_libraries( + hvlusb + ${LIBUSB_LIBRARIES} + ${LIBEVDEV_LIBRARIES} +# ${LIBUDEV_LIBRARIES} +) diff --git a/Makefile b/Makefile deleted file mode 100644 index 584da41..0000000 --- a/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -.PHONY: all clean archive - -obj-m += hanvon.o - -all: - gcc hanvon-libusb.c -I/usr/include/libevdev-1.0/ -L/usr/local/lib -lusb-1.0 -ludev -levdev -g -o hvlusb - -archive: - tar f - --exclude=.git -C ../ -c hanvon | gzip -c9 > ../hanvon-`date +%Y%m%d`.tgz diff --git a/README.md b/README.md index 7bdb2a2..20ea727 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,23 @@ Userspace driver for Hanvon pen tablets adapted from the original Linux kernel driver. Supports tablet features such as pen coordinates, x and y tilt angle, hover detection, pressure detection, and button input. +## Dependencies + cmake pkg-config make libusb-devel libevdev-devel + ## Building + mkdir build + cd build + cmake .. make ## Usage - sudo hvlusb + sudo ./hvlusb Run the output executable from a terminal with sudo (preferrably in the background). ## Supported Hardware -All tablets supported by the original driver should work with this libusb driver but only the GP0504 has been tested. +All tablets supported by the original driver should work, but only GP0504 has been tested. The original driver supported the following models: