From 50caea12551705e2fea3f75c2e5cb4bcc724a7a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20=C5=A0tetiar?= Date: Thu, 26 Sep 2019 06:29:52 +0200 Subject: [PATCH] cmake: fix include dirs and libs lookup MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In order to make it compile properly in more environments. Signed-off-by: Petr Å tetiar --- CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a52e5bd..8be878d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,16 @@ SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") SET(SOURCES main.c dns.c announce.c cache.c service.c util.c ubus.c interface.c) -SET(LIBS ubox ubus resolv blobmsg_json json-c) +FIND_PATH(ubox_include_dir NAMES libubox/usock.h) +FIND_PATH(ubus_include_dir NAMES libubus.h) +INCLUDE_DIRECTORIES(${ubox_include_dir} ${ubus_include_dir}) + +FIND_LIBRARY(ubox NAMES ubox) +FIND_LIBRARY(ubus NAMES ubus) +FIND_LIBRARY(blobmsg_json NAMES blobmsg_json) +FIND_LIBRARY(json NAMES json json-c) + +SET(LIBS ${ubox} ${ubus} ${blobmsg_json} ${json} resolv) IF(DEBUG) ADD_DEFINITIONS(-DDEBUG -g3) -- 2.30.2