dhcpv6: fix white space error
[project/odhcp6c.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8)
2 cmake_policy(SET CMP0015 NEW)
3
4 # Project Definition
5 project(odhcp6c C)
6 set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
7 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=c99")
8 set(LIBUBOX 1 CACHE BOOL "Link with libubox")
9 add_definitions(-D_GNU_SOURCE -Wall -Werror -Wextra -pedantic)
10
11 if(${EXT_PREFIX_CLASS})
12 add_definitions(-DEXT_PREFIX_CLASS=${EXT_PREFIX_CLASS})
13 endif(${EXT_PREFIX_CLASS})
14
15 if(${EXT_CER_ID})
16 add_definitions(-DEXT_CER_ID=${EXT_CER_ID})
17 endif(${EXT_CER_ID})
18
19 set(SOURCES src/odhcp6c.c src/dhcpv6.c src/ra.c src/script.c)
20 if(LIBUBOX EQUAL 0)
21 set(SOURCES ${SOURCES} src/md5.c)
22 endif()
23 add_executable(odhcp6c ${SOURCES})
24
25 set(LIBRARIES resolv)
26 if(LIBUBOX EQUAL 1)
27 set(LIBRARIES ${LIBRARIES} ubox)
28 endif()
29 target_link_libraries(odhcp6c ${LIBRARIES})
30
31 # Installation
32 install(TARGETS odhcp6c DESTINATION sbin/)
33
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 "6ac")
38 set(CPACK_GENERATOR "DEB;RPM;STGZ")
39 set(CPACK_STRIP_FILES true)
40
41 SET(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
42 set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}")
43
44 include(CPack)
45