• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/odhcp6c/CMakeLists.txt

  1 cmake_minimum_required(VERSION 3.13)
  2 cmake_policy(SET CMP0015 NEW)
  3 
  4 
  5 # Project Definition
  6 project(odhcp6c LANGUAGES C)
  7 add_executable(${PROJECT_NAME})
  8 target_sources(${PROJECT_NAME} PRIVATE
  9         src/config.c
 10         src/dhcpv6.c
 11         src/odhcp6c.c
 12         src/ra.c
 13         src/script.c
 14 )
 15 
 16 
 17 # Compiler Options
 18 set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 11)
 19 target_compile_definitions(${PROJECT_NAME} PRIVATE _GNU_SOURCE)
 20 target_compile_options(${PROJECT_NAME} PRIVATE -g3)
 21 target_compile_options(${PROJECT_NAME} PRIVATE -Os)
 22 target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
 23 target_compile_options(${PROJECT_NAME} PRIVATE -Werror)
 24 target_compile_options(${PROJECT_NAME} PRIVATE -Wextra)
 25 target_compile_options(${PROJECT_NAME} PRIVATE -Werror=implicit-function-declaration)
 26 target_compile_options(${PROJECT_NAME} PRIVATE -Wformat)
 27 target_compile_options(${PROJECT_NAME} PRIVATE -Werror=format-security)
 28 target_compile_options(${PROJECT_NAME} PRIVATE -Werror=format-nonliteral)
 29 target_compile_options(${PROJECT_NAME} PRIVATE -Wimplicit-fallthrough=5)
 30 target_compile_options(${PROJECT_NAME} PRIVATE -Wno-shadow=compatible-local)
 31 target_compile_options(${PROJECT_NAME} PRIVATE -Wno-unused-parameter)
 32 target_compile_options(${PROJECT_NAME} PRIVATE -Wmissing-declarations)
 33 target_compile_options(${PROJECT_NAME} PRIVATE -Wshadow=local)
 34 
 35 
 36 # Libraries
 37 target_link_libraries(${PROJECT_NAME} PRIVATE resolv)
 38 
 39 find_path(ubox_include_dir libubox/md5.h)
 40 target_include_directories(${PROJECT_NAME} PRIVATE ${ubox_include_dir})
 41 find_library(libubox ubox)
 42 target_link_libraries(${PROJECT_NAME} PRIVATE ${libubox})
 43 
 44 if(${UBUS})
 45         target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_UBUS)
 46         target_sources(${PROJECT_NAME} PRIVATE src/ubus.c)
 47         find_path(ubus_include_dir libubus.h)
 48         target_include_directories(${PROJECT_NAME} PRIVATE ${ubus_include_dir})
 49         find_library(libubus ubus)
 50         target_link_libraries(${PROJECT_NAME} PRIVATE ${libubus})
 51 endif(${UBUS})
 52 
 53 
 54 # Installation
 55 install(TARGETS ${PROJECT_NAME} DESTINATION sbin/)
 56 
 57 
 58 # Packaging information
 59 set(CPACK_PACKAGE_VERSION "1")
 60 set(CPACK_PACKAGE_CONTACT "Steven Barth <steven@midlink.org>")
 61 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME}")
 62 set(CPACK_GENERATOR "DEB;RPM;STGZ")
 63 set(CPACK_STRIP_FILES true)
 64 SET(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
 65 set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}")
 66 include(CPack)

This page was automatically generated by LXR 0.3.1.  •  OpenWrt