logswan

Fast Web log analyzer using probabilistic data structures
Log | Files | Refs | README | LICENSE

commit d240fda8f6a6f82cfbc06aa14eba8cb5d7a75a3d
parent 418925be865392199f1e9af65c1608f58de026a2
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Wed, 24 Jun 2015 23:43:12 +0200

Modifying CMakeList to link strtonum conditionally

Diffstat:
MCMakeLists.txt | 16+++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -3,6 +3,7 @@ # Logswan (c) by Frederic Cambus 2015 # # https://github.com/fcambus/logswan # # # +# Created: 2015/05/31 # # Last Updated: 2015/06/07 # # # ############################################################################### @@ -11,12 +12,21 @@ cmake_minimum_required (VERSION 2.6) project (logswan C) +include(CheckFunctionExists) +include_directories(/usr/local/include) + +check_function_exists(strtonum HAVE_STRTONUM) + find_library(LIB_GEOIP NAMES GeoIP REQUIRED) find_library(LIB_JANSSON NAMES jansson REQUIRED) -include_directories(/usr/local/include) -add_definitions(-Wall -Wextra -Werror -std=c99 -pedantic) +set (SRC src/logswan.c src/output.c src/parse.c) + +if(NOT HAVE_STRTONUM) + set (SRC ${SRC} compat/strtonum.c) +endif() -add_executable(logswan src/logswan.c src/output.c src/parse.c) +add_definitions(-Wall -Wextra -Werror -std=c99 -pedantic) +add_executable(logswan ${SRC}) target_link_libraries(logswan ${LIB_GEOIP} ${LIB_JANSSON})