X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuhttpd.git;a=blobdiff_plain;f=CMakeLists.txt;h=ec45c52ece76a10fd99c2079d635905327935f3a;hp=7273df6bb0b82535b4194baea4a36e9f264c2d00;hb=a6b0c13b1891667a27a8d60506456b288d3f0faa;hpb=991c32db310dba0cd99265d5360ecdbfd0fc3e89 diff --git a/CMakeLists.txt b/CMakeLists.txt index 7273df6..ec45c52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 2.6) PROJECT(uhttpd C) + +INCLUDE (CheckFunctionExists) + SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") ADD_DEFINITIONS(-Os -Wall -Werror -Wmissing-declarations --std=gnu99 -g3) @@ -24,6 +27,11 @@ IF(TLS_SUPPORT) ADD_DEFINITIONS(-DHAVE_TLS) ENDIF() +CHECK_FUNCTION_EXISTS(getspnam HAVE_SHADOW) +IF(HAVE_SHADOW) + ADD_DEFINITIONS(-DHAVE_SHADOW) +ENDIF() + ADD_EXECUTABLE(uhttpd ${SOURCES}) TARGET_LINK_LIBRARIES(uhttpd ubox dl ${LIBS}) @@ -60,8 +68,9 @@ ENDIF() IF(UBUS_SUPPORT) SET(PLUGINS ${PLUGINS} uhttpd_ubus) ADD_DEFINITIONS(-DHAVE_UBUS) - ADD_LIBRARY(uhttpd_ubus MODULE ubus.c ubus-session.c) - TARGET_LINK_LIBRARIES(uhttpd_ubus ubus ubox blobmsg_json json) + ADD_LIBRARY(uhttpd_ubus MODULE ubus.c) + FIND_LIBRARY(libjson NAMES json-c json) + TARGET_LINK_LIBRARIES(uhttpd_ubus ubus ubox blobmsg_json ${libjson}) ENDIF() IF(PLUGINS)