cmake: Find libubox/usock.h
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 11 Jul 2016 21:01:15 +0000 (14:01 -0700)
committerFelix Fietkau <nbd@nbd.name>
Wed, 27 Jul 2016 15:27:43 +0000 (17:27 +0200)
Add a CMake FIND_PATH and INCLUDE_DIRECTORIES searching for libubox/usock.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 8514351b98a3c1540ac454c22dbd2e8230ef2f24..7ae8ba4d13d64df719c2593e38f22991cf87139f 100644 (file)
@@ -21,6 +21,9 @@ IF(LIBS STREQUAL "LIBS-NOTFOUND")
        SET(LIBS "")
 ENDIF()
 
+FIND_PATH(ubox_include_dir libubox/usock.h)
+INCLUDE_DIRECTORIES(${ubox_include_dir})
+
 SET(SOURCES main.c listen.c client.c utils.c file.c auth.c cgi.c relay.c proc.c plugin.c handler.c)
 IF(TLS_SUPPORT)
        SET(SOURCES ${SOURCES} tls.c)