<commit_before># - Try to find Polkit
# Once done this will define
#
#  POLKIT_FOUND - system has Polkit
#  POLKIT_INCLUDE_DIRS - Polkit's include directories
#  POLKIT_AGENT_INCLUDE_DIRS - Polkit-agent's include directories
#  POLKIT_LIBRARIES - Link this to use polkit's gobject library
#  POLKIT_AGENT_LIBRARY - Link this to use the agent wrapper in polkit
#  POLKIT_DEFINITIONS - Compiler switches required for using Polkit

# Copyright (c) 2009, <NAME>, <<EMAIL>>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if (POLKIT_INCLUDE_DIR AND POLKIT_LIB)
    set(POLKIT_FIND_QUIETLY TRUE)
endif (POLKIT_INCLUDE_DIR AND POLKIT_LIB)

if (NOT WIN32)
   # use pkg-config to get the directories and then use these values
   # in the FIND_PATH() and FIND_LIBRARY() calls
   find_package(PkgConfig)
   pkg_check_modules(PC_POLKIT REQUIRED polkit-gobject-1)
   pkg_check_modules(PC_POLKIT_AGENT REQUIRED polkit-agent-1)
   set(POLKIT_DEFINITIONS ${PC_POLKIT_CFLAGS_OTHER})
endif (NOT WIN32)

# We must include glib paths too... which sucks balls
find_package(GLIB2)

find_path( GLIB_CONFIG_INCLUDE_DIR
     NAMES glibconfig.h
     PATH_SUFFIXES glib-2.0/include
     HINTS ${PC_POLKIT_INCLUDE_DIRS}
)

find_path( POLKIT_INCLUDE_DIR
     NAMES polkit/polkit.h
     PATH_SUFFIXES polkit-1
     HINTS ${PC_POLKIT_INCLUDE_DIRS}
)

find_path( POLKIT_AGENT_INCLUDE_DIR
     NAMES polkitagent/polkitagent.h
     PATH_SUFFIXES polkit-1
     HINTS ${PC_POLKIT_AGENT_INCLUDE_DIRS}
)

#set(POLKIT_INCLUDE_DIRS ${GLIB2_INCLUDE_DIR} ${_POLKIT_INCLUDE_DIR})
#set(POLKIT_AGENT_INCLUDE_DIRS ${GLIB2_INCLUDE_DIR} ${_POLKIT_AGENT_INCLUDE_DIR})

find_library( POLKIT_LIBRARIES
    NAMES polkit-gobject-1
    HINTS ${PC_POLKIT_LIBDIR}
)

find_library( POLKIT_AGENT_LIBRARY
    NAMES polkit-agent-1
    HINTS ${PC_POLKIT_AGENT_LIBDIR}
)

#set(POLKIT_LIBRARIES ${_POLKIT_LIBRARIES} ${GLIB2_LIBRARIES})
#set(POLKIT_AGENT_LIBRARY ${_POLKIT_AGENT_LIBRARY} ${GLIB2_LIBRARIES})

include(FindPackageHandleStandardArgs)

# handle the QUIETLY and REQUIRED arguments and set POLKIT_FOUND to TRUE if
# all listed variables are TRUE
find_package_handle_standard_args(Polkit DEFAULT_MSG POLKIT_LIBRARIES POLKIT_AGENT_LIBRARY
                                                     POLKIT_INCLUDE_DIR POLKIT_AGENT_INCLUDE_DIR GLIB2_FOUND)

mark_as_advanced(POLKIT_INCLUDE_DIRS POLKIT_AGENT_INCLUDE_DIRS POLKIT_LIBRARIES POLKIT_AGENT_LIBRARY GLIB_INCLUDE_DIR)

set(POLKIT_POLICY_FILES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/polkit-1/actions)
<commit_msg>-no need to use "REQUIRED" for pkg-config, since the result is checked later on anyway via find_package_handle_standard_args()<commit_after># - Try to find Polkit
# Once done this will define
#
#  POLKIT_FOUND - system has Polkit
#  POLKIT_INCLUDE_DIRS - Polkit's include directories
#  POLKIT_AGENT_INCLUDE_DIRS - Polkit-agent's include directories
#  POLKIT_LIBRARIES - Link this to use polkit's gobject library
#  POLKIT_AGENT_LIBRARY - Link this to use the agent wrapper in polkit
#  POLKIT_DEFINITIONS - Compiler switches required for using Polkit

# Copyright (c) 2009, <NAME>, <<EMAIL>>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if (POLKIT_INCLUDE_DIR AND POLKIT_LIB)
    set(POLKIT_FIND_QUIETLY TRUE)
endif (POLKIT_INCLUDE_DIR AND POLKIT_LIB)

if (NOT WIN32)
   # use pkg-config to get the directories and then use these values
   # in the FIND_PATH() and FIND_LIBRARY() calls
   find_package(PkgConfig)
   pkg_check_modules(PC_POLKIT polkit-gobject-1)
   pkg_check_modules(PC_POLKIT_AGENT polkit-agent-1)
   set(POLKIT_DEFINITIONS ${PC_POLKIT_CFLAGS_OTHER})
endif (NOT WIN32)

# We must include glib paths too... which sucks balls
find_package(GLIB2)

find_path( GLIB_CONFIG_INCLUDE_DIR
     NAMES glibconfig.h
     PATH_SUFFIXES glib-2.0/include
     HINTS ${PC_POLKIT_INCLUDE_DIRS}
)

find_path( POLKIT_INCLUDE_DIR
     NAMES polkit/polkit.h
     PATH_SUFFIXES polkit-1
     HINTS ${PC_POLKIT_INCLUDE_DIRS}
)

find_path( POLKIT_AGENT_INCLUDE_DIR
     NAMES polkitagent/polkitagent.h
     PATH_SUFFIXES polkit-1
     HINTS ${PC_POLKIT_AGENT_INCLUDE_DIRS}
)

#set(POLKIT_INCLUDE_DIRS ${GLIB2_INCLUDE_DIR} ${_POLKIT_INCLUDE_DIR})
#set(POLKIT_AGENT_INCLUDE_DIRS ${GLIB2_INCLUDE_DIR} ${_POLKIT_AGENT_INCLUDE_DIR})

find_library( POLKIT_LIBRARIES
    NAMES polkit-gobject-1
    HINTS ${PC_POLKIT_LIBDIR}
)

find_library( POLKIT_AGENT_LIBRARY
    NAMES polkit-agent-1
    HINTS ${PC_POLKIT_AGENT_LIBDIR}
)

#set(POLKIT_LIBRARIES ${_POLKIT_LIBRARIES} ${GLIB2_LIBRARIES})
#set(POLKIT_AGENT_LIBRARY ${_POLKIT_AGENT_LIBRARY} ${GLIB2_LIBRARIES})

include(FindPackageHandleStandardArgs)

# handle the QUIETLY and REQUIRED arguments and set POLKIT_FOUND to TRUE if
# all listed variables are TRUE
find_package_handle_standard_args(Polkit DEFAULT_MSG POLKIT_LIBRARIES POLKIT_AGENT_LIBRARY
                                                     POLKIT_INCLUDE_DIR POLKIT_AGENT_INCLUDE_DIR GLIB2_FOUND)

mark_as_advanced(POLKIT_INCLUDE_DIRS POLKIT_AGENT_INCLUDE_DIRS POLKIT_LIBRARIES POLKIT_AGENT_LIBRARY GLIB_INCLUDE_DIR)

set(POLKIT_POLICY_FILES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/polkit-1/actions)

{'fraction_non_alphanumeric': 0.06571267181321785, 'fraction_numerical': 0.008661269064206363, 'mean_word_length': 5.084765177548682, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6514751', 'n_tokens_mistral': 2212, 'n_tokens_neox': 1988, 'n_words': 422}