X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuhttpd.git;a=blobdiff_plain;f=CMakeLists.txt;h=ec45c52ece76a10fd99c2079d635905327935f3a;hp=0d9dcd43f5cb565d1040003d927d4195b4c5ecae;hb=a6b0c13b1891667a27a8d60506456b288d3f0faa;hpb=f8573c7b4c3a9e1a67cae787690f27a976aee11c diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d9dcd4..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}) @@ -61,7 +69,8 @@ IF(UBUS_SUPPORT) SET(PLUGINS ${PLUGINS} uhttpd_ubus) ADD_DEFINITIONS(-DHAVE_UBUS) ADD_LIBRARY(uhttpd_ubus MODULE ubus.c) - TARGET_LINK_LIBRARIES(uhttpd_ubus ubus ubox blobmsg_json json) + FIND_LIBRARY(libjson NAMES json-c json) + TARGET_LINK_LIBRARIES(uhttpd_ubus ubus ubox blobmsg_json ${libjson}) ENDIF() IF(PLUGINS)