Skip to content

Commit

Permalink
Only link libusb if sixpair is to be used (Fixes #406)
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Dec 12, 2020
1 parent dd034f3 commit 4b6c779
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ target_link_libraries(psmove psmoveapi)
set_property(TARGET psmove PROPERTY FOLDER "Utilities")
list(APPEND PSMOVEAPI_INSTALL_TARGETS psmove)

if (WIN32)
include(${CMAKE_CURRENT_LIST_DIR}/libusb.cmake)
target_link_libraries(psmove ${LIBUSB_LIBRARIES})
else()
# sixpair needs libusb
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBUSB REQUIRED libusb)
include_directories(${LIBUSB_INCLUDE_DIRS})
target_link_libraries(psmove ${LIBUSB_LIBRARIES})
if(PSMOVE_USE_SIXPAIR)
if (WIN32)
include(${CMAKE_CURRENT_LIST_DIR}/libusb.cmake)
target_link_libraries(psmove ${LIBUSB_LIBRARIES})
else()
# sixpair needs libusb
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBUSB REQUIRED libusb)
include_directories(${LIBUSB_INCLUDE_DIRS})
target_link_libraries(psmove ${LIBUSB_LIBRARIES})
endif()
endif()

0 comments on commit 4b6c779

Please sign in to comment.