cmake: Find libubox/ulog.h
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 1 Jul 2016 23:06:41 +0000 (16:06 -0700)
committerJohn Crispin <john@phrozen.org>
Fri, 1 Jul 2016 13:25:31 +0000 (15:25 +0200)
Add a CMake FIND_PATH and INCLUDE_DIRECTORIES searching for
libubox/ulog.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 a6002e5fe9e0b2a390d59d38ce75b8cffeaa8122..9a5a583c46bf8c72b116f6c5ca102374d3af7702 100644 (file)
@@ -38,6 +38,9 @@ ADD_LIBRARY(ubi-utils STATIC
                libubi/ubiutils-common.c)
 INSTALL(TARGETS ubi-utils ARCHIVE DESTINATION lib)
 
+FIND_PATH(ubox_include_dir libubox/ulog.h)
+INCLUDE_DIRECTORIES(${ubox_include_dir})
+
 SET_TARGET_PROPERTIES(ubi-utils PROPERTIES COMPILE_FLAGS
                "-ffunction-sections -fdata-sections")