forked from galsalomon66/s3select
-
Notifications
You must be signed in to change notification settings - Fork 22
/
CMakeLists.txt
59 lines (46 loc) · 1.6 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
cmake_minimum_required(VERSION 3.0)
project(s3select)
find_package(Arrow QUIET)
if(Arrow_FOUND)
message( "arrow is installed")
add_definitions(-D_ARROW_EXIST)
endif()
if(DEFINED ENV{DEBUG})
set(CMAKE_CXX_FLAGS "-std=gnu++17 -ggdb -Wnon-virtual-dtor -Wreorder -Wunused-variable -Wtype-limits -Wsign-compare -Wmaybe-uninitialized")
else()
set(CMAKE_CXX_FLAGS "-std=gnu++17 -ggdb -Wnon-virtual-dtor -Wreorder -Wunused-variable -Wtype-limits -Wsign-compare -Wmaybe-uninitialized -O3")
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Boost REQUIRED)
find_package(GTest REQUIRED)
if(DEFINED ENV{NANO_SEC})
add_definitions(-DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG)
endif()
set(REGEX_EN)
if(REGEX_EN MATCHES "HS")
find_path(HYPERSCAN_INCLUDE_DIR NAMES hs/hs.h)
find_library(HYPERSCAN_LIB1 NAMES hs)
find_library(HYPERSCAN_LIB2 NAMES hs_runtime)
set(HYPERSCAN_LIB $(HYPERSCAN_LIB1) $(HYPERSCAN_LIB2))
if(HYPERSCAN_INCLUDE_DIR AND HYPERSCAN_LIB)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lhs")
add_definitions(-DREGEX_HS)
message(STATUS "Hyperscan is set as regex engine")
else()
message(WARNING "-- Hyperscan not found --")
endif()
elseif(REGEX_EN MATCHES "RE2")
find_path(RE2_INCLUDE_DIR NAMES re2/re2.h)
find_library(RE2_LIB NAMES re2)
if(RE2_INCLUDE_DIR AND RE2_LIB)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lre2")
add_definitions(-DREGEX_RE2)
message(STATUS "re2 is set as regex engine")
else()
message(WARNING "-- re2 not found --")
endif()
endif()
enable_testing()
add_subdirectory(example)
add_subdirectory(test)