cmake: Find uci.h
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 11 Jul 2016 22:02:13 +0000 (15:02 -0700)
committerJohn Crispin <john@phrozen.org>
Sun, 24 Jul 2016 04:25:07 +0000 (06:25 +0200)
Add a CMake FIND_PATH and INCLUDE_DIRECTORIES searching for uci.h. Some
external toolchains which do not include standard locations would fail
to find the header otherwise.

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

index 2e712cd7ac08626885dde3f25290e4e96b68b6cb..b37d26c2e737a5049fcb062a4fa4e14926bb6fa9 100644 (file)
@@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 2.6)
 PROJECT(mountd C)
 ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations)
 
+FIND_PATH(ubus_include_dir libubus.h)
+INCLUDE_DIRECTORIES(${ubus_include_dir})
+
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 
 ADD_EXECUTABLE(mountd main.c log.c sys.c autofs.c mount.c timer.c signal.c ucix.c led.c fs.c ucix.c)