summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2022-02-20 10:41:53 +0100
committerPetr Štetiar <ynezz@true.cz>2022-02-20 10:41:53 +0100
commit136006b88826feff4f0a36ffab511d1366483cf2 (patch)
tree66e9da54755a82ff6139222a8fc6302b542cc7e8
parentbc0e84d689e2240a1bdfba3c04070485390bbfe9 (diff)
downloadnetifd-136006b88826feff4f0a36ffab511d1366483cf2.tar.gz
cmake: fix usage of implicit library and include paths
And thus allow building in out of tree setups etc. Signed-off-by: Petr Štetiar <ynezz@true.cz>
-rw-r--r--CMakeLists.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bcb5133..b3bf411 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,8 +24,16 @@ SET(SOURCES
extdev.c bonding.c)
-SET(LIBS
- ubox ubus uci json-c blobmsg_json)
+FIND_LIBRARY(uci NAMES uci)
+FIND_LIBRARY(ubox NAMES ubox)
+FIND_LIBRARY(ubus NAMES ubus)
+FIND_LIBRARY(json NAMES json-c json)
+FIND_LIBRARY(blobmsg_json NAMES blobmsg_json)
+
+SET(LIBS ${ubox} ${ubus} ${uci} ${json} ${blobmsg_json})
+
+FIND_PATH(ubox_include_dir libubox/usock.h)
+INCLUDE_DIRECTORIES(${ubox_include_dir})
IF (NOT DEFINED LIBNL_LIBS)
include(FindPkgConfig)