cgi-io: Find and search for libubus.h
authorFlorian Fainelli <f.fainelli@gmail.com>
Sun, 18 Jun 2017 19:45:30 +0000 (12:45 -0700)
committerFlorian Fainelli <f.fainelli@gmail.com>
Sun, 18 Jun 2017 19:45:30 +0000 (12:45 -0700)
Fixes build errors with external toolchains:

[ 33%] Building C object CMakeFiles/cgi-io.dir/main.c.o
/home/florian/dev/openwrt/trunk/build_dir/target-mipsel-unknown-linux-gnu_glibc/cgi-io/main.c:30:21:
fatal error: libubus.h: No such file or directory
 #include <libubus.h>
                     ^
compilation terminated.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Makefile
src/CMakeLists.txt

index c36231a12d4cad3a34fc9fdeeedbe965f31eb5a7..3032ca49b92e8e0673f805b702e6f37aed762f50 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cgi-io
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_LICENSE:=GPL-2.0+
 
index 8a4ca192c5ad28b361ae7dfdaf98dc15cde8bfee..6d8b1585a8b2a26c04839b5679038a9e96f59819 100644 (file)
@@ -4,6 +4,9 @@ PROJECT(cgi-io C)
 
 INCLUDE(CheckFunctionExists)
 
+FIND_PATH(ubus_include_dir libubus.h)
+INCLUDE_DIRECTORIES(${ubus_include_dir})
+
 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
 
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")