<commit_before># - Locate DAVIX library
# Defines:
#
#  DAVIX_FOUND
#  DAVIX_INCLUDE_DIR
#  DAVIX_INCLUDE_DIRS (not cached)
#  DAVIX_LIBRARIES

find_path(DAVIX_INCLUDE_DIR NAMES davix.hpp PATH_SUFFIXES davix HINTS ${DAVIX}/include $ENV{DAVIX}/include ${DAVIX_DIR}/include $ENV{DAVIX_DIR}/include)
find_library(DAVIX_LIBRARY NAMES davix HINTS ${DAVIX}/lib $ENV{DAVIX}/lib ${DAVIX_DIR}/lib $ENV{DAVIX_DIR}/lib64 ${DAVIX_DIR}/lib $ENV{DAVIX_DIR}/lib64)

set(DAVIX_INCLUDE_DIRS ${DAVIX_INCLUDE_DIR})
set(DAVIX_LIBRARIES ${DAVIX_LIBRARY})

# Handle the QUIETLY and REQUIRED arguments and set DAVIX_FOUND to TRUE if all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DAVIX DEFAULT_MSG DAVIX_INCLUDE_DIR DAVIX_LIBRARY)

mark_as_advanced(DAVIX_FOUND DAVIX_INCLUDE_DIR DAVIX_LIBRARY)
<commit_msg>Update FindDavix.cmake to use PkgConfig<commit_after>#.rst:
# FindDavix
# -------
#
# Find Davix library for file management over HTTP-based protocols.
#
# Imported Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines :prop_tgt:`IMPORTED` target:
#
# ``Davix::Davix``
#   The libdavix library, if found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module will set the following variables in your project:
#
# ``DAVIX_FOUND``
#   True if Davix has been found.
# ``DAVIX_INCLUDE_DIRS``
#   Where to find davix.hpp, etc.
# ``DAVIX_LIBRARIES``
#   The libraries to link against to use Davix.
# ``DAVIX_VERSION``
#   The version of the Davix library found (e.g. 0.6.4)
#
# Obsolete variables
# ^^^^^^^^^^^^^^^^^^
#
# The following variables may also be set, for backwards compatibility:
#
# ``DAVIX_LIBRARY``
#   where to find the DAVIX library.
# ``DAVIX_INCLUDE_DIR``
#   where to find the DAVIX headers (same as DAVIX_INCLUDE_DIRS)
#
# Since Davix depends on OpenSSL and LibXml2, none of the above will be defined
# unless both packages can be found.

if(Davix_FIND_QUIETLY)
  set(_FIND_DEPS_ARG QUIET)
endif()

foreach(var FOUND INCLUDE_DIR INCLUDE_DIRS LIBRARY LIBRARIES)
  unset(DAVIX_${var} CACHE)
endforeach()

find_package(LibXml2 ${_FIND_DEPS_ARG})
find_package(OpenSSL ${_FIND_DEPS_ARG})

if(LIBXML2_FOUND AND OPENSSL_FOUND)
  find_path(DAVIX_INCLUDE_DIR davix.hpp PATH_SUFFIXES davix/include)

  if(${Davix_FIND_REQUIRED})
    set(Davix_REQUIRED REQUIRED)
  endif()

  find_package(PkgConfig REQUIRED)
  pkg_check_modules(DAVIX ${Davix_REQUIRED} davix>=${Davix_FIND_VERSION})

  set(DAVIX_LIBRARIES ${DAVIX_LDFLAGS} ${LIBXML2_LIBRARIES} ${OPENSSL_LIBRARIES})
  set(DAVIX_LIBRARY ${DAVIX_LIBRARIES})
  set(DAVIX_INCLUDE_DIRS ${DAVIX_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS})
  set(DAVIX_INCLUDE_DIR ${DAVIX_INCLUDE_DIRS})
endif()

if(DAVIX_FOUND AND NOT TARGET Davix::Davix)
  add_library(Davix::Davix INTERFACE IMPORTED)
  string(REPLACE "-D" "" DAVIX_DEFINITIONS ${DAVIX_CFLAGS_OTHER})
  set_target_properties(Davix::Davix PROPERTIES
    INTERFACE_COMPILE_DEFINITIONS "${DAVIX_DEFINITIONS}"
    INTERFACE_INCLUDE_DIRECTORIES "${DAVIX_INCLUDE_DIRS}"
    INTERFACE_LINK_LIBRARIES "${DAVIX_LIBRARIES}")
endif()

mark_as_advanced(DAVIX_INCLUDE_DIR DAVIX_LIBRARY)

{'fraction_non_alphanumeric': 0.11629392971246007, 'fraction_numerical': 0.0038338658146964857, 'mean_word_length': 6.544578313253012, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, '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': '2986740', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1208, 'n_words': 250}