From a76382c2bb9eb7cf3c79d746e296e88d82ba8b60 Mon Sep 17 00:00:00 2001 From: Shawn Nock Date: Wed, 8 May 2019 15:09:10 +0000 Subject: [PATCH] Use pkgconfig to find tinycbor --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 306a932..3a8d938 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,10 @@ if (DO_UPLOAD_SHA) target_sources(umcumgr PRIVATE src/sha256.c) endif () -find_library(TINYCBOR_LIB tinycbor /usr/local/lib /usr/lib) -target_link_libraries(umcumgr ${TINYCBOR_LIB}) +find_package(PkgConfig) + +PKG_CHECK_MODULES(CBOR REQUIRED tinycbor) +target_include_directories(umcumgr PRIVATE ${CBOR_INCLUDE_DIRS}) +target_link_libraries(umcumgr PRIVATE ${CBOR_LIBRARIES}) install(TARGETS umcumgr DESTINATION bin) \ No newline at end of file