You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
948 B
31 lines
948 B
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
|
unset(CMAKE_SHARED_MODULE_PREFIX) |
|
set(BACKENDS "") |
|
|
|
add_library("b_exec" MODULE "exec.c" "../strlcpy.c") |
|
list(APPEND BACKENDS "exec") |
|
|
|
if (WITH_REDIS) |
|
pkg_check_modules(REDIS "hiredis" REQUIRED) |
|
add_library("b_redis" MODULE "redis.c" "../strlcpy.c") |
|
target_link_libraries("b_redis" "hiredis") |
|
list(APPEND BACKENDS "redis") |
|
endif () |
|
|
|
if (WITH_IPSET) |
|
pkg_check_modules(IPSET "libipset" REQUIRED) |
|
if (IPSET_VERSION VERSION_LESS 7) |
|
add_library("b_ipset" MODULE "ipset6.c" "../strlcpy.c") |
|
else () |
|
add_library("b_ipset" MODULE "ipset7.c" "../strlcpy.c") |
|
endif () |
|
target_link_libraries("b_ipset" "ipset") |
|
list(APPEND BACKENDS "ipset") |
|
endif () |
|
|
|
foreach (BACKEND IN LISTS BACKENDS) |
|
set_target_properties("b_${BACKEND}" PROPERTIES OUTPUT_NAME "backend_${BACKEND}") |
|
install(TARGETS "b_${BACKEND}" LIBRARY DESTINATION ${PLUGINS_PATH}) |
|
endforeach () |
|
|
|
message(STATUS "- Backends : ${BACKENDS}")
|
|
|