CMakeLists.txt 676 B

123456789101112131415161718192021222324
  1. cmake_minimum_required(VERSION 3.10)
  2. PROJECT(qosify C)
  3. ADD_DEFINITIONS(-Os -Wall -Wno-unknown-warning-option -Wno-array-bounds -Wno-format-truncation -Werror --std=gnu99)
  4. SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
  5. IF (NOT DEFINED LIBNL_LIBS)
  6. include(FindPkgConfig)
  7. pkg_search_module(LIBNL libnl-3.0 libnl-3 libnl nl-3 nl)
  8. IF (LIBNL_FOUND)
  9. include_directories(${LIBNL_INCLUDE_DIRS})
  10. SET(LIBNL_LIBS ${LIBNL_LIBRARIES})
  11. ENDIF()
  12. ENDIF()
  13. find_library(bpf NAMES bpf)
  14. ADD_EXECUTABLE(qosify main.c loader.c map.c ubus.c interface.c dns.c)
  15. TARGET_LINK_LIBRARIES(qosify ${bpf} ubox ubus ${LIBNL_LIBS})
  16. INSTALL(TARGETS qosify
  17. RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
  18. )