ucode: add ucode plugin support
[project/uhttpd.git] / CMakeLists.txt
index 7ae8ba4d13d64df719c2593e38f22991cf87139f..564842d8844be8ef9d5be49c380ad5bb1a75b15e 100644 (file)
@@ -10,6 +10,7 @@ ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -Os -Wall -Werror -Wmissing-declarations
 OPTION(TLS_SUPPORT "TLS support" ON)
 OPTION(LUA_SUPPORT "Lua support" ON)
 OPTION(UBUS_SUPPORT "ubus support" ON)
+OPTION(UCODE_SUPPORT "ucode support" ON)
 
 IF(APPLE)
   INCLUDE_DIRECTORIES(/opt/local/include)
@@ -69,6 +70,13 @@ IF(LUA_SUPPORT)
        TARGET_LINK_LIBRARIES(uhttpd_lua ${LUA_LIBS} m dl)
 ENDIF()
 
+IF(UCODE_SUPPORT)
+       SET(PLUGINS ${PLUGINS} uhttpd_ucode)
+       ADD_DEFINITIONS(-DHAVE_UCODE)
+       ADD_LIBRARY(uhttpd_ucode MODULE ucode.c)
+       TARGET_LINK_LIBRARIES(uhttpd_ucode ucode ${libjson})
+ENDIF()
+
 IF(UBUS_SUPPORT)
        SET(PLUGINS ${PLUGINS} uhttpd_ubus)
        ADD_DEFINITIONS(-DHAVE_UBUS)