Merge pull request #4 from dedeckeh/master
[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
11 add_definitions(-D_GNU_SOURCE -Wall -Werror -Wextra -DWITH_UBUS)
12
13 if(${EXT_PREFIX_CLASS})
14         add_definitions(-DEXT_PREFIX_CLASS=${EXT_PREFIX_CLASS})
15 endif(${EXT_PREFIX_CLASS})
16
17
18 add_executable(odhcpd src/odhcpd.c src/config.c src/router.c src/dhcpv6.c src/ndp.c src/md5.c src/dhcpv6-ia.c src/dhcpv4.c src/ubus.c)
19 target_link_libraries(odhcpd resolv ubus ubox uci)
20
21 # Installation
22 install(TARGETS odhcpd DESTINATION sbin/)
23
24
25 # Packaging information
26 set(CPACK_PACKAGE_VERSION "1")
27 set(CPACK_PACKAGE_CONTACT "Steven Barth <steven@midlink.org>")
28 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "odhcpd")
29 set(CPACK_GENERATOR "DEB;RPM;STGZ")
30 set(CPACK_STRIP_FILES true)
31
32 SET(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
33 set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}")
34
35 include(CPack)
36