<commit_before>###### HTMLEXT #################################################################

# Allow cmake to set VERSION variables
# https://cmake.org/cmake/help/latest/policy/CMP0048.html
cmake_policy(SET CMP0048 NEW)
project(htmlext VERSION 0.5)

cmake_minimum_required(VERSION 3.8 FATAL_ERROR)

# Add the top-level cmake module directory to CMAKE_MODULE_PATH
list(INSERT CMAKE_MODULE_PATH 0 ${PROJECT_SOURCE_DIR}/cmake)

include(HextEnableWarnings)

# If build type was not specified, build Release.
include(HextDefaultBuildRelease)


###### VERSION #################################################################
configure_file(
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/Version.cpp.in"
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/Version.cpp"
  # Restrict variable replacement to references of the form @VAR@
  @ONLY)


###### DEPENDENCIES ############################################################
include_directories("${PROJECT_SOURCE_DIR}/htmlext")

if(USE_SYSTEM_LIBHEXT)
  find_package(Hext REQUIRED)
  include_directories(${HEXT_INCLUDE_DIR})
else()
  add_subdirectory("libhext")
  include_directories("${PROJECT_SOURCE_DIR}/libhext/include")
endif()

find_package(Boost COMPONENTS program_options REQUIRED)

find_package(RapidJSON REQUIRED)
include_directories(${RapidJSON_INCLUDE_DIRS})


###### SOURCES #################################################################
add_executable(
  htmlext
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/ErrorOutput.cpp"
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/File.cpp"
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/Json.cpp"
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/ProgramOptions.cpp"
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/Version.cpp"
  "${PROJECT_SOURCE_DIR}/htmlext/main.cpp")
hext_enable_warnings(htmlext PRIVATE)
if(USE_SYSTEM_LIBHEXT)
  set(TARGET_LINK_LIBHEXT ${HEXT_LIBRARY})
else()
  add_dependencies(htmlext hext)
  set(TARGET_LINK_LIBHEXT hext)
endif()
target_link_libraries(
  htmlext
  ${TARGET_LINK_LIBHEXT}
  Boost::program_options)


###### INSTALL #################################################################
install(TARGETS htmlext DESTINATION bin)<commit_msg>htmlext: cmake: remove option USE_SYSTEM_LIBHEXT<commit_after>###### HTMLEXT #################################################################

# Allow cmake to set VERSION variables
# https://cmake.org/cmake/help/latest/policy/CMP0048.html
cmake_policy(SET CMP0048 NEW)
project(htmlext VERSION 0.5)

cmake_minimum_required(VERSION 3.8 FATAL_ERROR)

# Add the top-level cmake module directory to CMAKE_MODULE_PATH
list(INSERT CMAKE_MODULE_PATH 0 ${PROJECT_SOURCE_DIR}/cmake)

include(HextEnableWarnings)

# If build type was not specified, build Release.
include(HextDefaultBuildRelease)


###### VERSION #################################################################
configure_file(
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/Version.cpp.in"
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/Version.cpp"
  # Restrict variable replacement to references of the form @VAR@
  @ONLY)


###### DEPENDENCIES ############################################################
include_directories("${PROJECT_SOURCE_DIR}/htmlext")

add_subdirectory("libhext")
include_directories("${PROJECT_SOURCE_DIR}/libhext/include")

find_package(Boost COMPONENTS program_options REQUIRED)

find_package(RapidJSON REQUIRED)
include_directories(${RapidJSON_INCLUDE_DIRS})


###### SOURCES #################################################################
add_executable(
  htmlext
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/ErrorOutput.cpp"
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/File.cpp"
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/Json.cpp"
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/ProgramOptions.cpp"
  "${PROJECT_SOURCE_DIR}/htmlext/htmlext/Version.cpp"
  "${PROJECT_SOURCE_DIR}/htmlext/main.cpp")
hext_enable_warnings(htmlext PRIVATE)
add_dependencies(htmlext hext)
target_link_libraries(
  htmlext
  hext
  Boost::program_options)


###### INSTALL #################################################################
install(TARGETS htmlext DESTINATION bin)
{'fraction_non_alphanumeric': 0.2579453067257945, 'fraction_numerical': 0.006405518600640552, 'mean_word_length': 8.712918660287082, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '175370', 'n_tokens_mistral': 1418, 'n_tokens_neox': 1309, 'n_words': 190}