Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
739c6e4
Fix policy-warning in cmake output for different cmake versions
bagong May 22, 2016
c940d26
win: towards a windows version
sensestage Nov 5, 2014
0fffed1
win: initial state that compiles
llloret May 9, 2016
3b30c96
win: collection parsing started
llloret May 11, 2016
b317698
win: element parsing
llloret May 12, 2016
b4578eb
win: initial version of element value getting
llloret May 13, 2016
069aded
win: get values seems ok
llloret May 15, 2016
2c5cf28
win: remove preparsed_data experiment
llloret May 15, 2016
044981d
win: starting to parse buttons correctly
llloret May 19, 2016
4e27e89
win: properly create elements and refactor
llloret May 19, 2016
6a9a5c8
win: some reformatting
llloret May 20, 2016
bbe86b1
win: some tidying up, and update header file
llloret May 20, 2016
a8d77d7
do not the DDK to compile now
llloret May 22, 2016
2ba471c
fix logical values for buttons, DEBUG_PARSER, C99 loop variable
llloret May 22, 2016
9746dea
Win: Add extended hidsdi.h for MinGW build
bagong May 25, 2016
543ff12
Win: use added header in MinGW build
bagong May 25, 2016
71627a6
Win: generalize linked setupapi
bagong May 25, 2016
fea827f
Cross: install hut folder
bagong May 25, 2016
3d963f9
Cross: change hidapi folder to HID_Support
bagong May 25, 2016
2f599f2
Mac: install hut tables into app-bundle
bagong May 25, 2016
b11c66a
Provisional fix for install of HUT folder
bagong Jun 2, 2016
7edfb50
Merge pull request #1 from supercollider/hid3.8
crucialfelix Sep 7, 2016
c365a40
Remove duplicate line regarding cmp0048
bagong Sep 15, 2016
4112eae
Merge pull request #2 from bagong/cmakepol
bagong Sep 15, 2016
ce7b972
Fix counter bug in hid_parse_input_report()
jmckernon Oct 2, 2016
38d3d66
Include windows.h to fix MinGW32 build, thanks sonoro1234
bagong Oct 21, 2016
608350e
Merge pull request #3 from jmckernon/topic/hid_parse_input_report_bugfix
bagong Oct 22, 2016
6666789
Merge pull request #4 from supercollider/mingwHandle
bagong Oct 22, 2016
4baeac8
Build hidapi against latest mingw-w64 headers (not guarded, perhaps b…
awson Nov 9, 2016
23ab8e2
Add comment to switch to global hidsdi.h
bagong Feb 6, 2017
7ec3943
Merge pull request #5 from awson/master
mossheim Feb 13, 2017
0f074b9
Fix Findlibusb cmake module for working on FreeBSD
shamazmazum Apr 10, 2017
3f64090
Merge pull request #8 from shamazmazum/freebsd-compat
mossheim Apr 11, 2017
78fdae4
cmake: bump to 3.0, use modern project() syntax
mossheim Apr 9, 2018
80a10ce
Merge pull request #10 from brianlheim/topic/policy0048
mossheim Jun 8, 2018
cc8e711
Undo "fix hidapi enumeration bug on OSX" - commit c43255b
gurk Jul 1, 2020
d1c0c5f
Merge pull request #14 from gurk/topic/fix-macos-event-loop-issue
mossheim Jul 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 29 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0048 OLD)
project(hidapi)

set(VERSION_MAJOR "0")
set(VERSION_MINOR "7")
set(VERSION_PATCH "1")
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
cmake_minimum_required(VERSION 3.0)

project(hidapi VERSION 0.7.1)

option(HID_DEBUG_PARSER "verbose parser debugging output" OFF)

Expand All @@ -16,7 +10,7 @@ option(HID_DEBUG_PARSER "verbose parser debugging output" OFF)
option(HID_EXAMPLE_TEST "build test example" OFF)
option(HID_EXAMPLE_OSC "build osc example" OFF)

option(HID_INSTALL_HUT "install hid usage tables" OFF)
option(HID_INSTALL_HUT "install hid usage tables" ON)

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(HIDAPI "default" CACHE STRING "HID API to use (one of {default,hidraw,libusb})")
Expand Down Expand Up @@ -96,17 +90,38 @@ if( HID_EXAMPLE_TEST )
if(APPLE)
add_subdirectory(hidtestosx)
endif()
if(WIN32)
add_subdirectory(hidtestwindows)
endif()
endif()

if( HID_EXAMPLE_OSC )
add_subdirectory(hidapi2osc)
endif()

if( HID_DEBUG_PARSER )
set(HID_HUT_PATH ${CMAKE_INSTALL_PREFIX}/share/hidapi CACHE STRING "Installation path for the HID usage tables")

if( HID_DEBUG_PARSER OR HID_INSTALL_HUT )
# provisional to avoid having to commit to sc master while the HID submodule
# is not final/added to master
# the sc-settings for cmake_install_prefix and scappauxresourcesdir are not
# visible in this scope
if(APPLE)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/Install")
endif()
# this will break if scappbundlename is reassigned in SC
# similar problem in editors/sc-ide/CMakeLists.txt 284
set(scappbundlename "SuperCollider")
set(scappauxresourcesdir "${scappbundlename}/${scappbundlename}.app/Contents/Resources")
set(HID_HUT_PATH "${CMAKE_INSTALL_PREFIX}/${scappauxresourcesdir}/HID_Support")
elseif(WIN32)
set(auxresourcesdir "SuperCollider" CACHE STRING "Resources directory")
set(HID_HUT_PATH "${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HID_Support")
else()
set(auxresourcesdir "share/SuperCollider" CACHE STRING "Resources directory")
set(HID_HUT_PATH "${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HID_Support")
endif(APPLE)
install(DIRECTORY hut
DESTINATION ${HID_HUT_PATH}
FILES_MATCHING PATTERN "*.yaml"
DESTINATION ${HID_HUT_PATH}
FILES_MATCHING PATTERN "*.yaml"
)
endif()
16 changes: 14 additions & 2 deletions cmake_modules/Findlibusb-1.0.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,25 @@
#


if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
# Remove prefix "1" as FreeBSD has its own implementation
# of libusb compatible with libusb1.
set(LIBUSB_1_HEADER_NAME "libusb.h")
set(LIBUSB_1_LIBRARY_NAME "usb")
else(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
# Just preserve values before my intrusion. 10.04.2017 Vasily
# Can it be just "libusb.h" for Linux also?
set(LIBUSB_1_HEADER_NAME "libusb-1.0/libusb.h")
set(LIBUSB_1_LIBRARY_NAME "usb-1.0")
endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")

if (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
# in cache already
set(LIBUSB_FOUND TRUE)
else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
find_path(LIBUSB_1_INCLUDE_DIR
NAMES
libusb-1.0/libusb.h
${LIBUSB_1_HEADER_NAME}
PATHS
/usr/include
/usr/local/include
Expand All @@ -61,7 +73,7 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)

find_library(LIBUSB_1_LIBRARY
NAMES
usb-1.0
${LIBUSB_1_LIBRARY_NAME}
PATHS
/usr/lib
/usr/local/lib
Expand Down
4 changes: 4 additions & 0 deletions hidapi/hidapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ extern "C" {
int HID_API_EXPORT HID_API_CALL hid_dump_element_info(hid_device *dev);
IOHIDDeviceRef HID_API_EXPORT HID_API_CALL get_device_handle( hid_device *dev );
#endif
#ifdef WIN32
#include <windows.h>
HANDLE HID_API_EXPORT HID_API_CALL get_device_handle(hid_device *dev);
#endif

#ifdef __cplusplus
}
Expand Down
Loading