CMakeLists.txt 956 B

12345678910111213141516171819202122232425262728293031323334
  1. cmake_minimum_required(VERSION 2.6)
  2. PROJECT(firewall3 C)
  3. ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations -Wno-format-truncation)
  4. SET(iptc_libs ip4tc)
  5. SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
  6. IF (NOT DISABLE_STATIC_EXTENSIONS)
  7. LIST(APPEND ext_libs iptext)
  8. LIST(APPEND ext_libs iptext4)
  9. IF (NOT DISABLE_IPV6)
  10. LIST(APPEND ext_libs iptext6)
  11. ENDIF()
  12. ELSE()
  13. ADD_DEFINITIONS(-DDISABLE_STATIC_EXTENSIONS)
  14. ENDIF()
  15. IF (NOT DISABLE_IPV6)
  16. LIST(APPEND iptc_libs ip6tc)
  17. ELSE()
  18. ADD_DEFINITIONS(-DDISABLE_IPV6)
  19. ENDIF()
  20. FIND_PATH(uci_include_dir uci.h)
  21. INCLUDE_DIRECTORIES(${uci_include_dir})
  22. ADD_EXECUTABLE(firewall3 main.c options.c defaults.c zones.c forwards.c rules.c redirects.c snats.c utils.c ubus.c ipsets.c includes.c iptables.c helpers.c)
  23. TARGET_LINK_LIBRARIES(firewall3 uci ubox ubus xtables m dl ${iptc_libs} ${ext_libs})
  24. SET(CMAKE_INSTALL_PREFIX /usr)
  25. INSTALL(TARGETS firewall3 RUNTIME DESTINATION sbin)