1 cmake_minimum_required(VERSION 2.8)
2 cmake_policy(SET CMP0015 NEW)
7 set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
8 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=c99")
11 add_definitions(-D_GNU_SOURCE -Wall -Werror -Wextra)
13 if(${EXT_PREFIX_CLASS})
14 add_definitions(-DEXT_PREFIX_CLASS=${EXT_PREFIX_CLASS})
15 endif(${EXT_PREFIX_CLASS})
18 add_definitions(-DEXT_CER_ID=${EXT_CER_ID})
22 add_definitions(-DWITH_UBUS)
23 set(EXT_SRC ${EXT_SRC} src/ubus.c)
24 set(EXT_LINK ${EXT_LINK} ubus)
27 add_executable(odhcpd src/odhcpd.c src/config.c src/router.c src/dhcpv6.c src/ndp.c src/dhcpv6-ia.c src/dhcpv4.c ${EXT_SRC})
28 target_link_libraries(odhcpd resolv ubox uci ${EXT_LINK})
31 install(TARGETS odhcpd DESTINATION sbin/)
34 # Packaging information
35 set(CPACK_PACKAGE_VERSION "1")
36 set(CPACK_PACKAGE_CONTACT "Steven Barth <steven@midlink.org>")
37 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "odhcpd")
38 set(CPACK_GENERATOR "DEB;RPM;STGZ")
39 set(CPACK_STRIP_FILES true)
41 SET(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
42 set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}")