Cmake: only link against libusb-1.0 if it was found

This should work much better as libusb is really only required if you want
support for all the dive computers (e.g., Atomics Aquatics Cobalt family).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-08-16 12:33:28 -07:00
parent a8ce8c3ef1
commit 79f3f18ef6

View file

@ -147,7 +147,7 @@ else()
set(WEBKIT_LIB Qt5::WebKitWidgets)
endif()
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${LIBDIVECOMPUTER_LIBRARIES} ${LIBGIT2_LIBRARIES} ${GRANTLEE_LIBRARIES} -lusb-1.0)
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${LIBDIVECOMPUTER_LIBRARIES} ${LIBGIT2_LIBRARIES} ${GRANTLEE_LIBRARIES} ${LIBUSB_LIBRARIES})
# handle out of tree build correctly
string(COMPARE EQUAL "${${PROJECT_NAME}_SOURCE_DIR}" "${${PROJECT_NAME}_BINARY_DIR}" insource)