```cmake
#####################
# RE2 regex library #
#####################

ExternalProject_Add(
  RE2

  UPDATE_COMMAND ""
  PATCH_COMMAND ""

  SOURCE_DIR "${CMAKE_SOURCE_DIR}/ext/re2-2017-05-01"
  CMAKE_ARGS -BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=True -DCMAKE_INSTALL_PREFIX=${GLOBAL_OUTPUT_PATH}/re2

  TEST_COMMAND ""
)


set(RE2_LIBRARIES "${GLOBAL_OUTPUT_PATH}/re2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}re2${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(RE2_INCLUDE_DIRS "${GLOBAL_OUTPUT_PATH}/re2/include/")


include_directories(SYSTEM ${RE2_INCLUDE_DIRS})
```

Make sure the RE2 library is compiled with maximal optimization.
user
```cmake
#####################
# RE2 regex library #
#####################

ExternalProject_Add(
  RE2

  UPDATE_COMMAND ""
  PATCH_COMMAND ""

  SOURCE_DIR "${CMAKE_SOURCE_DIR}/ext/re2-2017-05-01"
  CMAKE_ARGS -BUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=True -DCMAKE_INSTALL_PREFIX=${GLOBAL_OUTPUT_PATH}/re2

  TEST_COMMAND ""
)


set(RE2_LIBRARIES "${GLOBAL_OUTPUT_PATH}/re2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}re2${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(RE2_INCLUDE_DIRS "${GLOBAL_OUTPUT_PATH}/re2/include/")


include_directories(SYSTEM ${RE2_INCLUDE_DIRS})
```
assistant