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 8db786e949225d63cf2cd70707672baff5ef13a8..0301db5655b0a4e37dc810950f6c6209d9b87575 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)