Skip to content

Commit 2a948ca

Browse files
committed
cmake: handle tinyb dependency through upm_init_module macro
Signed-off-by: Mihai Tudor Panu <[email protected]>
1 parent d282d47 commit 2a948ca

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ pkg_check_modules (OPENZWAVE libopenzwave)
155155

156156
# Check for TinyB
157157
pkg_check_modules (TINYB tinyb>=0.5.1)
158+
# And get full path to the tinyb library
159+
find_library(TINYB_LIBRARY NAMES tinyb HINTS ${TINYB_LIBDIR})
158160

159161
# Find JPEG
160162
find_package (JPEG)

src/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ function (_get_dependency_targets target return_variable)
6666
# reqlibname list (used in various items like pom files, .pc files, etc
6767
elseif (${deplib} MATCHES mraa)
6868
list(APPEND ${return_variable} mraa)
69+
elseif (${deplib} MATCHES tinyb)
70+
list(APPEND ${return_variable} tinyb)
6971
endif (TARGET ${deplib})
7072
endforeach (deplib ${_dep_libs})
7173
# Uniquify
@@ -100,6 +102,8 @@ function (_gen_pkg_config_per_target LABEL)
100102
list(APPEND reqlibname ${deplibname})
101103
elseif (${deplib} MATCHES mraa)
102104
list(APPEND reqlibname mraa)
105+
elseif (${deplib} MATCHES tinyb)
106+
list(APPEND reqlibname tinyb)
103107
endif (TARGET ${deplib})
104108
endforeach (deplib ${DEPLIBS})
105109
# Make sure no dups exist
@@ -855,6 +859,9 @@ function(upm_module_init)
855859
target_link_libraries (${libname} ${MRAA_LIBRARY})
856860
# Always add a PUBLIC dependency to MRAA include dirs
857861
target_include_directories (${libname} PUBLIC ${MRAA_INCLUDE_DIRS})
862+
elseif (${linkflag} MATCHES tinyb)
863+
target_link_libraries (${libname} ${TINYB_LIBRARY})
864+
target_include_directories (${libname} PUBLIC ${TINYB_INCLUDE_DIRS})
858865
else ()
859866
# Else, add the linkflag directly
860867
target_link_libraries (${libname} ${linkflag})

0 commit comments

Comments
 (0)