2021-11-21 10:58:26 +00:00
|
|
|
option (USE_INTERNAL_RE2_LIBRARY "Set to FALSE to use system re2 library instead of bundled [slower]" ON)
|
2017-02-28 23:49:04 +00:00
|
|
|
|
2021-10-24 07:11:23 +00:00
|
|
|
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/re2/re2")
|
2019-05-15 17:19:39 +00:00
|
|
|
if(USE_INTERNAL_RE2_LIBRARY)
|
2021-10-17 23:29:04 +00:00
|
|
|
message(WARNING "submodule contrib/re2 is missing. to fix try run: \n git submodule update --init")
|
2020-08-14 15:44:04 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal re2 library")
|
2019-05-15 17:19:39 +00:00
|
|
|
endif()
|
|
|
|
set(USE_INTERNAL_RE2_LIBRARY 0)
|
|
|
|
set(MISSING_INTERNAL_RE2_LIBRARY 1)
|
|
|
|
endif()
|
|
|
|
|
2017-02-28 23:49:04 +00:00
|
|
|
if (NOT USE_INTERNAL_RE2_LIBRARY)
|
2017-04-01 07:20:54 +00:00
|
|
|
find_library (RE2_LIBRARY re2)
|
|
|
|
find_path (RE2_INCLUDE_DIR NAMES re2/re2.h PATHS ${RE2_INCLUDE_PATHS})
|
2020-08-14 15:44:04 +00:00
|
|
|
if (NOT RE2_LIBRARY OR NOT RE2_INCLUDE_DIR)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system re2 library")
|
|
|
|
endif ()
|
2017-02-28 23:49:04 +00:00
|
|
|
endif ()
|
|
|
|
|
2019-01-31 16:48:37 +00:00
|
|
|
string(FIND ${CMAKE_CURRENT_BINARY_DIR} " " _have_space)
|
|
|
|
if(_have_space GREATER 0)
|
|
|
|
message(WARNING "Using spaces in build path [${CMAKE_CURRENT_BINARY_DIR}] highly not recommended. Library re2st will be disabled.")
|
|
|
|
set (MISSING_INTERNAL_RE2_ST_LIBRARY 1)
|
|
|
|
endif()
|
|
|
|
|
2017-02-28 23:49:04 +00:00
|
|
|
if (RE2_LIBRARY AND RE2_INCLUDE_DIR)
|
2017-04-01 07:20:54 +00:00
|
|
|
set (RE2_ST_LIBRARY ${RE2_LIBRARY})
|
2019-01-31 17:13:42 +00:00
|
|
|
elseif (NOT MISSING_INTERNAL_RE2_LIBRARY)
|
2017-04-01 07:20:54 +00:00
|
|
|
set (USE_INTERNAL_RE2_LIBRARY 1)
|
|
|
|
set (RE2_LIBRARY re2)
|
2020-08-14 15:44:04 +00:00
|
|
|
set (RE2_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/re2")
|
2019-01-31 16:48:37 +00:00
|
|
|
if (NOT MISSING_INTERNAL_RE2_ST_LIBRARY)
|
|
|
|
set (RE2_ST_LIBRARY re2_st)
|
|
|
|
set (USE_RE2_ST 1)
|
|
|
|
else ()
|
|
|
|
set (RE2_ST_LIBRARY ${RE2_LIBRARY})
|
2020-08-14 15:44:04 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Using internal re2 library instead of re2_st")
|
2019-01-31 16:48:37 +00:00
|
|
|
endif ()
|
2017-02-28 23:49:04 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
message (STATUS "Using re2: ${RE2_INCLUDE_DIR} : ${RE2_LIBRARY}; ${RE2_ST_INCLUDE_DIR} : ${RE2_ST_LIBRARY}")
|