summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-04-10 12:08:26 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-04-10 12:08:26 -0700
commit7596db28b5ad55f8ff7cfd7c04eda8febe9ba012 (patch)
tree593f31b8e52846cd680dc0dba40fed2f4d58ffa5 /cmake
parent25467aa85a533638ad9c727539ebc093bba4c489 (diff)
downloadsubsurface-7596db28b5ad55f8ff7cfd7c04eda8febe9ba012.tar.gz
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>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/pkgconfig_helper.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmake/Modules/pkgconfig_helper.cmake b/cmake/Modules/pkgconfig_helper.cmake
index afb523855..f53a1064d 100644
--- a/cmake/Modules/pkgconfig_helper.cmake
+++ b/cmake/Modules/pkgconfig_helper.cmake
@@ -1,5 +1,5 @@
-MACRO(pkg_config_library LIBNAME pcfile)
- pkg_check_modules(${LIBNAME} REQUIRED ${pcfile})
+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})