cmake: Make FindHIDAPI add include dirs to imported targets

This commit is contained in:
Ryan Pavlik 2020-06-10 11:52:41 -05:00 committed by Jakob Bornecrantz
parent 138fcc49d8
commit 24e0202e3a

View file

@ -201,9 +201,9 @@ if(HIDAPI_FOUND)
if(NOT TARGET HIDAPI::hidapi) if(NOT TARGET HIDAPI::hidapi)
add_library(HIDAPI::hidapi UNKNOWN IMPORTED) add_library(HIDAPI::hidapi UNKNOWN IMPORTED)
set_target_properties(HIDAPI::hidapi PROPERTIES set_target_properties(HIDAPI::hidapi PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION ${HIDAPI_LIBRARY}) IMPORTED_LOCATION "${HIDAPI_LIBRARY}"
set_property(TARGET HIDAPI::hidapi PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${HIDAPI_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LIBRARIES Threads::Threads) IMPORTED_LINK_INTERFACE_LIBRARIES Threads::Threads)
endif() endif()
endif() endif()
@ -212,8 +212,8 @@ if(HIDAPI_libusb_FOUND AND NOT TARGET HIDAPI::hidapi-libusb)
add_library(HIDAPI::hidapi-libusb UNKNOWN IMPORTED) add_library(HIDAPI::hidapi-libusb UNKNOWN IMPORTED)
set_target_properties(HIDAPI::hidapi-libusb PROPERTIES set_target_properties(HIDAPI::hidapi-libusb PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION ${HIDAPI_LIBUSB_LIBRARY}) IMPORTED_LOCATION "${HIDAPI_LIBUSB_LIBRARY}"
set_property(TARGET HIDAPI::hidapi-libusb PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${HIDAPI_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LIBRARIES Threads::Threads) IMPORTED_LINK_INTERFACE_LIBRARIES Threads::Threads)
endif() endif()
@ -221,7 +221,7 @@ if(HIDAPI_hidraw_FOUND AND NOT TARGET HIDAPI::hidapi-hidraw)
add_library(HIDAPI::hidapi-hidraw UNKNOWN IMPORTED) add_library(HIDAPI::hidapi-hidraw UNKNOWN IMPORTED)
set_target_properties(HIDAPI::hidapi-hidraw PROPERTIES set_target_properties(HIDAPI::hidapi-hidraw PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION ${HIDAPI_HIDRAW_LIBRARY}) IMPORTED_LOCATION "${HIDAPI_HIDRAW_LIBRARY}"
set_property(TARGET HIDAPI::hidapi-hidraw PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${HIDAPI_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LIBRARIES Threads::Threads) IMPORTED_LINK_INTERFACE_LIBRARIES Threads::Threads)
endif() endif()