Browse Source

* update cmake

master
Alex 'AdUser' Z 8 years ago
parent
commit
d88cc64bbd
  1. 2
      CMakeLists.txt
  2. 7
      src/backends/CMakeLists.txt

2
CMakeLists.txt

@ -12,6 +12,7 @@ option(WITH_HARDENING "Enable hardening options" ON)
option(WITH_PCRE "Build pcre-compatible filter" ON) option(WITH_PCRE "Build pcre-compatible filter" ON)
option(WITH_REDIS "Build redis source/backend" OFF) option(WITH_REDIS "Build redis source/backend" OFF)
option(WITH_MCAST "Build mcast source/backend" OFF) option(WITH_MCAST "Build mcast source/backend" OFF)
option(WITH_IPSET "Build native ipset backend" OFF)
if (NOT DEFINED CMAKE_INSTALL_PREFIX) if (NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr") set(CMAKE_INSTALL_PREFIX "/usr")
@ -54,6 +55,7 @@ message(STATUS "- WITH_HARDENING : ${WITH_HARDENING}")
message(STATUS "- WITH_PCRE : ${WITH_PCRE}") message(STATUS "- WITH_PCRE : ${WITH_PCRE}")
message(STATUS "- WITH_REDIS : ${WITH_REDIS}") message(STATUS "- WITH_REDIS : ${WITH_REDIS}")
message(STATUS "- WITH_MCAST : ${WITH_MCAST}") message(STATUS "- WITH_MCAST : ${WITH_MCAST}")
message(STATUS "- WITH_IPSET : ${WITH_IPSET}")
message(STATUS "Components:") message(STATUS "Components:")
add_subdirectory(src) add_subdirectory(src)

7
src/backends/CMakeLists.txt

@ -17,6 +17,13 @@ if (WITH_REDIS AND REDIS_FOUND)
list(APPEND BACKENDS "f2b_backend_redis") list(APPEND BACKENDS "f2b_backend_redis")
endif () endif ()
find_library(IPSET_FOUND "ipset")
if (WITH_IPSET AND IPSET_FOUND)
add_library("f2b_backend_ipset" MODULE "ipset.c" "../strlcpy.c")
target_link_libraries("f2b_backend_ipset" "ipset")
list(APPEND BACKENDS "f2b_backend_ipset")
endif ()
message(STATUS "- Backends : ${BACKENDS}") message(STATUS "- Backends : ${BACKENDS}")
install(TARGETS ${BACKENDS} install(TARGETS ${BACKENDS}

Loading…
Cancel
Save