Skip to content
Merged
Changes from all commits
Commits
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
21 changes: 10 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2582,19 +2582,11 @@ endif()
find_package(LibUSB)

# USB HID controller support
find_package(hidapi)
option(HID "USB HID controller support" ON)
# hidapi_VERSION is only available starting with 0.10.0
default_option(HIDAPI_STATIC "Link HIDAPI library statically" "NOT hidapi_FOUND OR NOT hidapi_VERSION OR hidapi_VERSION VERSION_LESS 0.10.0")
if(HID)
target_sources(mixxx-lib PRIVATE
src/controllers/hid/hidcontroller.cpp
src/controllers/hid/hidenumerator.cpp
src/controllers/hid/hidcontrollerpreset.cpp
src/controllers/hid/hidcontrollerpresetfilehandler.cpp
)
target_compile_definitions(mixxx-lib PUBLIC __HID__)
if(HIDAPI_STATIC)
find_package(hidapi)
# hidapi_VERSION is only available starting with 0.10.0
if(NOT hidapi_FOUND OR NOT hidapi_VERSION OR hidapi_VERSION VERSION_LESS 0.10.0)
message(STATUS "Linking internal libhidapi statically")
add_library(mixxx-hidapi STATIC EXCLUDE_FROM_ALL)
target_include_directories(mixxx-hidapi SYSTEM PUBLIC lib/hidapi/hidapi)
Expand Down Expand Up @@ -2623,6 +2615,13 @@ if(HID)
endif()
target_link_libraries(mixxx-lib PUBLIC hidapi::hidapi)
endif()
target_sources(mixxx-lib PRIVATE
src/controllers/hid/hidcontroller.cpp
src/controllers/hid/hidenumerator.cpp
src/controllers/hid/hidcontrollerpreset.cpp
src/controllers/hid/hidcontrollerpresetfilehandler.cpp
)
target_compile_definitions(mixxx-lib PUBLIC __HID__)
endif()

# USB Bulk controller support
Expand Down