dhcpv6-ia : code style fixes
[project/odhcpd.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8)
2 cmake_policy(SET CMP0015 NEW)
3
4 # Project Definition
5 project(odhcpd C)
6
7 set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
8 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=c99")
9
10 FIND_PATH(ubox_include_dir libubox/uloop.h)
11 INCLUDE_DIRECTORIES(${ubox_include_dir})
12
13 add_definitions(-D_GNU_SOURCE -Wall -Werror -Wextra)
14
15 if (${EXT_CER_ID})
16         add_definitions(-DEXT_CER_ID=${EXT_CER_ID})
17 endif(${EXT_CER_ID})
18
19 if(${UBUS})
20         add_definitions(-DWITH_UBUS)
21         set(EXT_SRC ${EXT_SRC} src/ubus.c)
22         set(EXT_LINK ${EXT_LINK} ubus)
23 endif(${UBUS})
24
25 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})
26 target_link_libraries(odhcpd resolv ubox uci ${EXT_LINK})
27
28 # Installation
29 install(TARGETS odhcpd DESTINATION sbin/)
30
31
32 # Packaging information
33 set(CPACK_PACKAGE_VERSION "1")
34 set(CPACK_PACKAGE_CONTACT "Steven Barth <steven@midlink.org>")
35 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "odhcpd")
36 set(CPACK_GENERATOR "DEB;RPM;STGZ")
37 set(CPACK_STRIP_FILES true)
38
39 SET(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
40 set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}")
41
42 include(CPack)
43