Skip to content

Commit

Permalink
Merge pull request #3830 from daschuer/HIDAPI_STATIC
Browse files Browse the repository at this point in the history
Remove HIDAPI_STATIC, calculate it on the fly
  • Loading branch information
uklotzde authored May 6, 2021
2 parents 56bbacf + f341164 commit de70eba
Showing 1 changed file with 10 additions and 11 deletions.
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

0 comments on commit de70eba

Please sign in to comment.