<commit_before># Copyright (c) 2015, <NAME>
# All rights reserved.

include(hunter_status_debug)
include(hunter_test_string_not_empty)
include(hunter_unsetvar)

function(hunter_flush_cache_variables hunter_self)
  hunter_test_string_not_empty("${hunter_self}")

  hunter_status_debug("Flushing cache")

  # Read list of all cache variables and unset '*_{ROOT|Dir|DIR}' {
  get_directory_property(cache_list CACHE_VARIABLES)

  foreach(x ${cache_list})
    set(cleanup FALSE)
    if(x MATCHES "^.*_ROOT$")
      set(cleanup TRUE)
    endif()
    if(x MATCHES "^.*_DIR$")
      set(cleanup TRUE)
    endif()
    if(x MATCHES "^.*_Dir$")
      set(cleanup TRUE)
    endif()

    # Exclude standard variables {
    set(
        std_variables_list
        CMAKE_ROOT
        CMAKE_INCLUDE_CURRENT_DIR
        CMAKE_INSTALL_NAME_DIR
        CMAKE_CACHEFILE_DIR
        # Internal Hunter variables
        HUNTER_ROOT
        HUNTER_CACHED_ROOT
    )
    foreach(std_variable ${std_variables_list})
      string(COMPARE EQUAL "${std_variable}" "${x}" is_std_var)
      if(is_std_var)
        set(cleanup FALSE)
      endif()
    endforeach()

    set(
        std_patterns_list
        LIST_DIR
        SOURCE_DIR<commit_msg>More patterns for cache cleanup<commit_after># Copyright (c) 2015, <NAME>
# All rights reserved.

include(hunter_status_debug)
include(hunter_test_string_not_empty)
include(hunter_unsetvar)

function(hunter_flush_cache_variables hunter_self)
  hunter_test_string_not_empty("${hunter_self}")

  hunter_status_debug("Flushing cache")

  # Read list of all cache variables and unset '*_{ROOT|Dir|DIR}' {
  get_directory_property(cache_list CACHE_VARIABLES)

  foreach(x ${cache_list})
    set(cleanup FALSE)
    if(x MATCHES "^.*_ROOT$")
      set(cleanup TRUE)
    endif()
    if(x MATCHES "^.*_DIR$")
      set(cleanup TRUE)
    endif()
    if(x MATCHES "^.*_Dir$")
      set(cleanup TRUE)
    endif()

    # Issue https://github.com/ruslo/hunter/issues/569 {
    if(x MATCHES "^Boost_.*_LIBRARY_.*$")
      set(cleanup TRUE)
    endif()

    if(x MATCHES "^Boost_LIBRARY_DIR_.*$")
      set(cleanup TRUE)
    endif()

    if(x MATCHES "^_Boost_LIBRARY_DIR_.*_LAST$")
      set(cleanup TRUE)
    endif()
    # }

    # Exclude standard variables {
    set(
        std_variables_list
        CMAKE_ROOT
        CMAKE_INCLUDE_CURRENT_DIR
        CMAKE_INSTALL_NAME_DIR
        CMAKE_CACHEFILE_DIR
        # Internal Hunter variables
        HUNTER_ROOT
        HUNTER_CACHED_ROOT
    )
    foreach(std_variable ${std_variables_list})
      string(COMPARE EQUAL "${std_variable}" "${x}" is_std_var)
      if(is_std_var)
        set(cleanup FALSE)
      endif()
    endforeach()

    set(
        std_patterns_list
        LIST_DIR
        SOURCE_DIR
{'fraction_non_alphanumeric': 0.10130246020260492, 'fraction_numerical': 0.003979739507959479, 'mean_word_length': 3.1084695393759287, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '927476', 'n_tokens_mistral': 1017, 'n_tokens_neox': 935, 'n_words': 181}