cmake: do not cache libusb library if libusb-1.0 headers not found

Library found might be an older libusb version.

Closes #158


Former-commit-id: 12783e1cfd3902954a9513ca1baf53433add742a
This commit is contained in:
Floris Bos 2014-09-08 15:39:15 +02:00
parent f12bffb44f
commit 265656cc35

View File

@ -87,6 +87,7 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
message(STATUS " - Libraries: ${LIBUSB_1_LIBRARIES}")
endif (NOT libusb_1_FIND_QUIETLY)
else (LIBUSB_1_FOUND)
unset(LIBUSB_1_LIBRARY CACHE)
if (libusb_1_FIND_REQUIRED)
message(FATAL_ERROR "Could not find libusb")
endif (libusb_1_FIND_REQUIRED)