uqmi: search for ubox, blobmsg_json and json include paths
authorBachtin, Dmitri <dbachtin@init-ka.de>
Fri, 20 Nov 2015 06:34:35 +0000 (07:34 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 22 Nov 2015 11:37:10 +0000 (12:37 +0100)
CMake will search for include paths via FIND_PATH() of the following
libraries: libubox, blobmsg_json and json. This allows to build uqmi
when the dependencies are in non-standard locations by specifying
respective _include_dir variables.

CMakeLists.txt

index 4a115449ea4df8e6e8d569d81973e64a6828eb9a..96ebd47c678613a0a91027b65fdb8e53a65da82c 100644 (file)
@@ -10,6 +10,11 @@ SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 
 SET(SOURCES main.c dev.c commands.c qmi-message.c)
 
+FIND_PATH(ubox_include_dir libubox/usock.h)
+FIND_PATH(blobmsg_json_include_dir libubox/blobmsg_json.h)
+FIND_PATH(json_include_dir json-c/json.h json/json.h json.h)
+INCLUDE_DIRECTORIES(${ubox_include_dir} ${blobmsg_json_include_dir} ${json_include_dir})
+
 IF(BUILD_STATIC)
   FIND_LIBRARY(json NAMES libjson.a libjson-c.a)
   FIND_LIBRARY(blobmsg_json NAMES libblobmsg_json.a)