cmake: Find libubox/blobmsg_json.h
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 11 Jul 2016 22:34:36 +0000 (15:34 -0700)
committerFelix Fietkau <nbd@nbd.name>
Tue, 19 Jul 2016 12:22:28 +0000 (14:22 +0200)
Add a CMake FIND_PATH and INCLUDE_DIRECTORIES searching for
libubox/blobmsg_json.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 260cfbe4770af450953c624d97259a6bedbae631..95d757ff8594bbe734baa5474a428bcecca876df 100644 (file)
@@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 2.6)
 PROJECT(usbmode C)
 ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations)
 
+FIND_PATH(ubox_include_dir libubox/blobmsg_json.h)
+INCLUDE_DIRECTORIES(${ubox_include_dir})
+
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 
 SET(SOURCES main.c switch.c)