mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-30 18:38:32 +00:00
FindOpenHMD: Handle transitive link of libhidapi better.
This commit is contained in:
parent
67a561d0ea
commit
4687955b17
|
@ -66,14 +66,20 @@ find_library(OPENHMD_LIBRARY
|
||||||
PATH_SUFFIXES
|
PATH_SUFFIXES
|
||||||
lib
|
lib
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if(NOT WIN32)
|
||||||
find_library(OPENHMD_LIBRT rt)
|
find_library(OPENHMD_LIBRT rt)
|
||||||
find_library(OPENHMD_LIBM m)
|
find_library(OPENHMD_LIBM m)
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(Threads QUIET)
|
find_package(Threads QUIET)
|
||||||
|
|
||||||
set(_ohmd_extra_deps)
|
set(_ohmd_extra_deps)
|
||||||
|
|
||||||
set(OPENHMD_HIDAPI_TYPE)
|
set(OPENHMD_HIDAPI_TYPE)
|
||||||
|
if(OPENHMD_LIBRARY AND "${OPENHMD_LIBRARY}" MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
|
# Looks like a static library
|
||||||
if(PC_OPENHMD_FOUND)
|
if(PC_OPENHMD_FOUND)
|
||||||
# See if we need a particular hidapi.
|
# See if we need a particular hidapi.
|
||||||
list(REMOVE_ITEM PC_OPENHMD_LIBRARIES openhmd)
|
list(REMOVE_ITEM PC_OPENHMD_LIBRARIES openhmd)
|
||||||
|
@ -85,7 +91,9 @@ if(PC_OPENHMD_FOUND)
|
||||||
set(OPENHMD_HIDAPI_TYPE hidraw)
|
set(OPENHMD_HIDAPI_TYPE hidraw)
|
||||||
find_package(HIDAPI QUIET COMPONENTS hidraw)
|
find_package(HIDAPI QUIET COMPONENTS hidraw)
|
||||||
list(APPEND _ohmd_extra_deps HIDAPI_hidraw_FOUND)
|
list(APPEND _ohmd_extra_deps HIDAPI_hidraw_FOUND)
|
||||||
elseif("${PC_OPENHMD_LIBRARIES}" MATCHES hidapi)
|
endif()
|
||||||
|
endif()
|
||||||
|
if(NOT PC_OPENHMD_FOUND OR NOT OPENHMD_HIDAPI_TYPE)
|
||||||
# Undifferentiated
|
# Undifferentiated
|
||||||
set(OPENHMD_HIDAPI_TYPE undifferentiated)
|
set(OPENHMD_HIDAPI_TYPE undifferentiated)
|
||||||
find_package(HIDAPI QUIET)
|
find_package(HIDAPI QUIET)
|
||||||
|
|
Loading…
Reference in a new issue