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

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