X-Git-Url: http://git.archive.openwrt.org/?p=project%2Frpcd.git;a=blobdiff_plain;f=CMakeLists.txt;h=4cef7d6ab67558191e451c9c77e60d6173ecef90;hp=b5b164a20da177e23e5493dd6bdf48cb5070d831;hb=2f5a613718f5297febddb3ca7dc860ab6ed8c513;hpb=22fbf13086653cba0c60d60ceb7baba2f33a034d diff --git a/CMakeLists.txt b/CMakeLists.txt index b5b164a..4cef7d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,10 @@ cmake_minimum_required(VERSION 2.6) +INCLUDE(CheckFunctionExists) + PROJECT(rpcd C) -ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations -Iinclude) +ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations) +INCLUDE_DIRECTORIES(include) OPTION(FILE_SUPPORT "File plugin support" ON) OPTION(IWINFO_SUPPORT "libiwinfo plugin support" ON) @@ -13,10 +16,19 @@ IF(APPLE) LINK_DIRECTORIES(/opt/local/lib) ENDIF() +CHECK_FUNCTION_EXISTS(getspnam HAVE_SHADOW) +IF(HAVE_SHADOW) + ADD_DEFINITIONS(-DHAVE_SHADOW) +ENDIF() + FIND_LIBRARY(json NAMES json-c json) +FIND_LIBRARY(crypt NAMES crypt) +IF(crypt STREQUAL "LIBS-NOTFOUND") + SET(crypt "") +ENDIF() ADD_EXECUTABLE(rpcd main.c exec.c session.c uci.c plugin.c) -TARGET_LINK_LIBRARIES(rpcd ubox ubus uci dl blobmsg_json ${json}) +TARGET_LINK_LIBRARIES(rpcd ubox ubus uci dl blobmsg_json ${json} ${crypt}) SET(PLUGINS "")