cmake: fix usage of implicit library and include paths
authorPetr Štetiar <ynezz@true.cz>
Sun, 20 Feb 2022 09:41:53 +0000 (10:41 +0100)
committerPetr Štetiar <ynezz@true.cz>
Sun, 20 Feb 2022 09:41:53 +0000 (10:41 +0100)
And thus allow building in out of tree setups etc.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
CMakeLists.txt

index bcb5133deda050155caf5f6c9a339a4a3db37aa5..b3bf411880f6f22936ac9af05f0d1389ff180a02 100644 (file)
@@ -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)