cmake: Find libubus.h
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 11 Jul 2016 21:03:49 +0000 (14:03 -0700)
committerFelix Fietkau <nbd@nbd.name>
Wed, 27 Jul 2016 15:28:46 +0000 (17:28 +0200)
Add a CMake FIND_PATH and INCLUDE_DIRECTORIES searching for libubus.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 60959d552d1328b21320a5a779da5be47305af67..49aa4176fbc75b413987c1dcee3e2ad272a8e2dd 100644 (file)
@@ -28,6 +28,9 @@ IF(crypt STREQUAL "crypt-NOTFOUND")
   SET(crypt "")
 ENDIF()
 
+FIND_PATH(ubus_include_dir libubus.h)
+INCLUDE_DIRECTORIES(${ubus_include_dir})
+
 ADD_EXECUTABLE(rpcd main.c exec.c session.c uci.c plugin.c)
 TARGET_LINK_LIBRARIES(rpcd ubox ubus uci dl blobmsg_json ${json} ${crypt})