subsurface/cmake/Modules/pkgconfig_helper.cmake
Dirk Hohndel 7596db28b5 cmake: allow looking for optional libraries
And use this to look for libusb.
If it's there then libdivecomputer likely was linked against it. If it isn't
then we don't need it, either.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-10 12:08:26 -07:00

7 lines
335 B
CMake

MACRO(pkg_config_library LIBNAME pcfile option)
pkg_check_modules(${LIBNAME} ${option} ${pcfile})
include_directories(${${LIBNAME}_INCLUDE_DIRS})
link_directories(${${LIBNAME}_LIBRARY_DIRS})
add_definitions(${${LIBNAME}_CFLAGS_OTHER})
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${${LIBNAME}_LIBRARIES})
ENDMACRO()