<commit_before>cmake_minimum_required(VERSION 3.11)

project(CXX_host LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

find_package(XCFun CONFIG QUIET)
if(TARGET XCFun::xcfun)
  get_property(_loc TARGET XCFun::xcfun PROPERTY LOCATION)
  message(STATUS "Found XCFun: ${_loc} (found version ${XCFun_VERSION})")
else()
  message(STATUS "Suitable XCFun could not be located. Fetching and building!")
  include(FetchContent)
  FetchContent_Declare(xcfun_sources
    QUIET
    URL
      https://github.com/dftlibs/xcfun/archive/v2.0.0.tar.gz
    )

  FetchContent_GetProperties(xcfun_sources)

  set(ENABLE_TESTALL FALSE CACHE BOOL "")
  set(XCFUN_PYTHON_INTERFACE FALSE CACHE BOOL "")

  if(NOT xcfun_sources_POPULATED)
    FetchContent_Populate(xcfun_sources)

    add_subdirectory(
      ${xcfun_sources_SOURCE_DIR}
      ${xcfun_sources_BINARY_DIR}
      )
  endif()
endif()

enable_testing()

foreach(_src example)
  add_executable(${_src} ${_src}.cpp)
  target_link_libraries(${_src}
    PUBLIC
      XCFun::xcfun
    )
  add_test(
    NAME ${_src}
    COMMAND $<TARGET_FILE:${_src}>
    )
endforeach()
<commit_msg>Update C++ example to use v2.0.1<commit_after>cmake_minimum_required(VERSION 3.11)

project(CXX_host LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

find_package(XCFun CONFIG QUIET)
if(TARGET XCFun::xcfun)
  get_property(_loc TARGET XCFun::xcfun PROPERTY LOCATION)
  message(STATUS "Found XCFun: ${_loc} (found version ${XCFun_VERSION})")
else()
  message(STATUS "Suitable XCFun could not be located. Fetching and building!")
  include(FetchContent)
  FetchContent_Declare(xcfun_sources
    QUIET
    URL
      https://github.com/dftlibs/xcfun/archive/v2.0.1.tar.gz
    )

  FetchContent_GetProperties(xcfun_sources)

  set(ENABLE_TESTALL FALSE CACHE BOOL "")
  set(XCFUN_PYTHON_INTERFACE FALSE CACHE BOOL "")

  if(NOT xcfun_sources_POPULATED)
    FetchContent_Populate(xcfun_sources)

    add_subdirectory(
      ${xcfun_sources_SOURCE_DIR}
      ${xcfun_sources_BINARY_DIR}
      )
  endif()
endif()

enable_testing()

foreach(_src example)
  add_executable(${_src} ${_src}.cpp)
  target_link_libraries(${_src}
    PUBLIC
      XCFun::xcfun
    )
  add_test(
    NAME ${_src}
    COMMAND $<TARGET_FILE:${_src}>
    )
endforeach()

{'fraction_non_alphanumeric': 0.1037536904259806, 'fraction_numerical': 0.008013496415014762, 'mean_word_length': 4.813725490196078, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7226668', 'n_tokens_mistral': 952, 'n_tokens_neox': 887, 'n_words': 155}