cmake: Find libubox/utils.h header file
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 1 Jul 2016 23:04:05 +0000 (16:04 -0700)
committerFelix Fietkau <nbd@nbd.name>
Sat, 2 Jul 2016 14:52:31 +0000 (16:52 +0200)
Add a CMake FIND_PATH and INCLUDE_DIRECTORIES searching for
libubox/utils.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 68f50ff00b23bd947e4f20ededc8b8c60cf7f939..50a9226941c3eb688763561aadf1dcda48854334 100644 (file)
@@ -9,6 +9,8 @@ SET(LIBS)
 IF(USE_LIBUBOX)
   ADD_DEFINITIONS(-DUSE_LIBUBOX)
   SET(LIBS ubox)
+  FIND_PATH(ubox_include_dir libubox/utils.h)
+  INCLUDE_DIRECTORIES(${ubox_include_dir})
 ELSE()
   SET(SOURCES ${SOURCES} base64.c)
 ENDIF()