cmake: Find libubox/list.h header file
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 1 Jul 2016 23:06:16 +0000 (16:06 -0700)
committerFelix Fietkau <nbd@nbd.name>
Sat, 2 Jul 2016 08:15:16 +0000 (10:15 +0200)
Add a CMake FIND_PATH and INCLUDE_DIRECTORIES searching for
libubox/list.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 8db786e..0301db5 100644 (file)
@@ -37,6 +37,9 @@ ADD_CUSTOM_COMMAND(
   COMMENT "Generating parser.c"
 )
 
+FIND_PATH(ubox_include_dir libubox/list.h)
+INCLUDE_DIRECTORIES(${ubox_include_dir})
+
 SET_PROPERTY(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "lemon;parser.h;parser.out")
 SET_SOURCE_FILES_PROPERTIES("parser.c" PROPERTIES GENERATED TRUE)
 ADD_EXECUTABLE(jsonpath main.c ast.c lexer.c parser.c matcher.c)