2017-10-05 03:31:35 +00:00
|
|
|
# PCRE2 needs some settings.
|
2020-03-14 23:11:35 +00:00
|
|
|
set(PCRE2_WIDTH ${WCHAR_T_BITS})
|
|
|
|
set(PCRE2_BUILD_PCRE2_8 OFF CACHE BOOL "Build 8bit PCRE2 library")
|
|
|
|
set(PCRE2_BUILD_PCRE2_${PCRE2_WIDTH} ON CACHE BOOL "Build ${PCRE2_WIDTH}bit PCRE2 library")
|
|
|
|
set(PCRE2_SHOW_REPORT OFF CACHE BOOL "Show the final configuration report")
|
|
|
|
set(PCRE2_BUILD_TESTS OFF CACHE BOOL "Build tests")
|
|
|
|
set(PCRE2_BUILD_PCRE2GREP OFF CACHE BOOL "Build pcre2grep")
|
2017-10-05 03:31:35 +00:00
|
|
|
|
2020-03-14 23:11:35 +00:00
|
|
|
set(PCRE2_MIN_VERSION 10.21)
|
2020-02-12 22:54:28 +00:00
|
|
|
IF (NOT APPLE)
|
2020-03-14 23:11:35 +00:00
|
|
|
find_library(PCRE2_LIB pcre2-${PCRE2_WIDTH})
|
|
|
|
find_path(PCRE2_INCLUDE_DIR pcre2.h)
|
|
|
|
endif()
|
2017-10-05 03:31:35 +00:00
|
|
|
IF (PCRE2_LIB AND PCRE2_INCLUDE_DIR)
|
2020-03-14 23:11:35 +00:00
|
|
|
message(STATUS "Found system PCRE2 library ${PCRE2_INCLUDE_DIR}")
|
|
|
|
else()
|
|
|
|
message(STATUS "Using bundled PCRE2 library")
|
|
|
|
add_subdirectory(pcre2 EXCLUDE_FROM_ALL)
|
|
|
|
set(PCRE2_INCLUDE_DIR ${CMAKE_BINARY_DIR}/pcre2)
|
|
|
|
set(PCRE2_LIB pcre2-${PCRE2_WIDTH})
|
|
|
|
endif(PCRE2_LIB AND PCRE2_INCLUDE_DIR)
|
|
|
|
include_directories(${PCRE2_INCLUDE_DIR})
|