<commit_before>
include(FindPkgConfig)

if (PKG_CONFIG_FOUND)
	pkg_check_modules(PCSC libpcsclite)
endif()

find_path(PCSC_INCLUDE_DIR pcsclite.h
	PATHS ${PCSC_INCLUDE_DIRS}
	PATH_SUFFIXES PCSC)

find_library(PCSC_LIBRARY pcsclite
	PATHS ${PCSC_LIBRARY_DIRS})

# Windows and Mac detection from http://www.cmake.org/Bug/print_bug_page.php?bug_id=11325
IF(NOT PCSC_FOUND)
	# Will find PC/SC headers both on Mac and Windows
	FIND_PATH(PCSC_INCLUDE_DIRS WinSCard.h)
	# PCSC library is for Mac, WinSCard library is for Windows
	FIND_LIBRARY(PCSC_LIBRARY NAMES PCSC WinSCard)
ENDIF(NOT PCSC_FOUND)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCSC DEFAULT_MSG PCSC_INCLUDE_DIR PCSC_LIBRARY)

mark_as_advanced(PCSC_INCLUDE_DIR PCSC_LIBRARY)
<commit_msg>build: cleaned up and fixed PCSC detection<commit_after># - Try to find PCSC
# Once done this will define
#  PCSC_FOUND - pcsc was found
#  PCSC_INCLUDE_DIRS - pcsc include directories
#  PCSC_LIBRARIES - libraries needed for linking

include(FindPkgConfig)
if (PKG_CONFIG_FOUND)
  pkg_check_modules(PC_PCSC QUIET libpcsclite)
endif()

find_path(PCSC_INCLUDE_DIR pcsclite.h WinSCard.h
          HINTS ${PC_PCSC_INCLUDEDIR} ${PC_PCSC_INCLUDE_DIRS}
          PATH_SUFFIXES PCSC)

find_library(PCSC_LIBRARY NAMES PCSC WinSCard pcsclite 
             HINTS ${PC_PCSC_LIBDIR} ${PC_PCSC_LIBRARY_DIRS})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PCSC DEFAULT_MSG PCSC_LIBRARY PCSC_INCLUDE_DIR)

set(PCSC_LIBRARIES ${PCSC_LIBRARY})
set(PCSC_INCLUDE_DIRS ${PCSC_INCLUDE_DIR})

mark_as_advanced(PCSC_INCLUDE_DIR PCSC_LIBRARY)

{'fraction_non_alphanumeric': 0.06632975363234365, 'fraction_numerical': 0.003158559696778269, 'mean_word_length': 6.615384615384615, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '2088815', 'n_tokens_mistral': 669, 'n_tokens_neox': 616, 'n_words': 121}