summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--cmake/modules/FindHIDAPI.cmake87
-rw-r--r--cmake/modules/Findhidapi.cmake87
3 files changed, 89 insertions, 89 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9151ccc0a..10571d0fed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2440,7 +2440,7 @@ endif()
find_package(LibUSB)
# USB HID controller support
-find_package(HIDAPI)
+find_package(hidapi)
option(HID "USB HID controller support" ON)
cmake_dependent_option(HIDAPI_STATIC "Link HIDAPI library statically" OFF "HIDAPI_FOUND" ON)
if(HID)
@@ -2478,7 +2478,7 @@ if(HID)
if(NOT HIDAPI_FOUND)
message(FATAL_ERROR "USB HID controller support requires libhidapi-libusb and its development headers.")
endif()
- target_link_libraries(mixxx-lib PUBLIC HIDAPI::LibUSB)
+ target_link_libraries(mixxx-lib PUBLIC hidapi::hidapi)
endif()
endif()
diff --git a/cmake/modules/FindHIDAPI.cmake b/cmake/modules/FindHIDAPI.cmake
deleted file mode 100644
index 699fd31670..0000000000
--- a/cmake/modules/FindHIDAPI.cmake
+++ /dev/null
@@ -1,87 +0,0 @@
-# This file is part of Mixxx, Digital DJ'ing software.
-# Copyright (C) 2001-2020 Mixxx Development Team
-# Distributed under the GNU General Public Licence (GPL) version 2 or any later
-# later version. See the LICENSE file for details.
-
-#[=======================================================================[.rst:
-FindHIDAPI
-----------
-
-Finds the HIDAPI library.
-
-Imported Targets
-^^^^^^^^^^^^^^^^
-
-This module provides the following imported targets, if found:
-
-``HIDAPI::libusb``
- The hidapi-libusb library
-
-Result Variables
-^^^^^^^^^^^^^^^^
-
-This will define the following variables:
-
-``HIDAPI_FOUND``
- True if the system has the HIDAPI library.
-``HIDAPI_INCLUDE_DIRS``
- Include directories needed to use HIDAPI.
-``HIDAPI_LIBRARIES``
- Libraries needed to link to HIDAPI.
-``HIDAPI_DEFINITIONS``
- Compile definitions needed to use HIDAPI.
-
-Cache Variables
-^^^^^^^^^^^^^^^
-
-The following cache variables may also be set:
-
-``HIDAPI_INCLUDE_DIR``
- The directory containing ``hidapi/hidapi.h``.
-``HIDAPI_LIBRARY``
- The path to the hidapi-lbusb library.
-
-#]=======================================================================]
-
-find_package(PkgConfig QUIET)
-if(PkgConfig_FOUND)
- pkg_check_modules(PC_HIDAPI QUIET hidapi-libusb)
-endif()
-
-find_path(HIDAPI_INCLUDE_DIR
- NAMES hidapi.h
- PATHS ${PC_HIDAPI_INCLUDE_DIRS}
- PATH_SUFFIXES hidapi
- DOC "HIDAPI include directory")
-mark_as_advanced(HIDAPI_INCLUDE_DIR)
-
-find_library(HIDAPI_LIBRARY
- NAMES hidapi-libusb hidapi
- PATHS ${PC_HIDAPI_LIBRARY_DIRS}
- DOC "HIDAPI library"
-)
-mark_as_advanced(HIDAPI_LIBRARY)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(
- HIDAPI
- DEFAULT_MSG
- HIDAPI_LIBRARY
- HIDAPI_INCLUDE_DIR
-)
-
-if(HIDAPI_FOUND)
- set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARY}")
- set(HIDAPI_INCLUDE_DIRS "${HIDAPI_INCLUDE_DIR}")
- set(HIDAPI_DEFINITIONS ${PC_HIDAPI_CFLAGS_OTHER})
-
- if(NOT TARGET HIDAPI::LibUSB)
- add_library(HIDAPI::LibUSB UNKNOWN IMPORTED)
- set_target_properties(HIDAPI::LibUSB
- PROPERTIES
- IMPORTED_LOCATION "${HIDAPI_LIBRARY}"
- INTERFACE_COMPILE_OPTIONS "${PC_HIDAPI_CFLAGS_OTHER}"
- INTERFACE_INCLUDE_DIRECTORIES "${HIDAPI_INCLUDE_DIR}"
- )
- endif()
-endif()
diff --git a/cmake/modules/Findhidapi.cmake b/cmake/modules/Findhidapi.cmake
new file mode 100644
index 0000000000..8984767583
--- /dev/null
+++ b/cmake/modules/Findhidapi.cmake
@@ -0,0 +1,87 @@
+# This file is part of Mixxx, Digital DJ'ing software.
+# Copyright (C) 2001-2020 Mixxx Development Team
+# Distributed under the GNU General Public Licence (GPL) version 2 or any later
+# later version. See the LICENSE file for details.
+
+#[=======================================================================[.rst:
+Findhidapi
+----------
+
+Finds the hidapi library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module provides the following imported targets, if found:
+
+``hidapi::libusb``
+ The hidapi-libusb library
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables:
+
+``hidapi_FOUND``
+ True if the system has the hidapi library.
+``hidapi_INCLUDE_DIRS``
+ Include directories needed to use hidapi.
+``hidapi_LIBRARIES``
+ Libraries needed to link to hidapi.
+``hidapi_DEFINITIONS``
+ Compile definitions needed to use hidapi.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``hidapi_INCLUDE_DIR``
+ The directory containing ``hidapi/hidapi.h``.
+``hidapi_LIBRARY``
+ The path to the hidapi-lbusb library.
+
+#]=======================================================================]
+
+find_package(PkgConfig QUIET)
+if(PkgConfig_FOUND)
+ pkg_check_modules(PC_hidapi QUIET hidapi-libusb)
+endif()
+
+find_path(hidapi_INCLUDE_DIR
+ NAMES hidapi.h
+ PATHS ${PC_hidapi_INCLUDE_DIRS}
+ PATH_SUFFIXES hidapi
+ DOC "hidapi include directory")
+mark_as_advanced(hidapi_INCLUDE_DIR)
+
+find_library(hidapi_LIBRARY
+ NAMES hidapi-libusb hidapi
+ PATHS ${PC_hidapi_LIBRARY_DIRS}
+ DOC "hidapi library"
+)
+mark_as_advanced(hidapi_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ hidapi
+ DEFAULT_MSG
+ hidapi_LIBRARY
+ hidapi_INCLUDE_DIR
+)
+
+if(hidapi_FOUND)
+ set(hidapi_LIBRARIES "${hidapi_LIBRARY}")
+ set(hidapi_INCLUDE_DIRS "${hidapi_INCLUDE_DIR}")
+ set(hidapi_DEFINITIONS ${PC_hidapi_CFLAGS_OTHER})
+
+ if(NOT TARGET hidapi::hidapi)
+ add_library(hidapi::hidapi UNKNOWN IMPORTED)
+ set_target_properties(hidapi::hidapi
+ PROPERTIES
+ IMPORTED_LOCATION "${hidapi_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_hidapi_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${hidapi_INCLUDE_DIR}"
+ )
+ endif()
+endif()