<commit_before>include (LibAddMacros)

if (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 8)
	if (CMAKE_PATCH_VERSION LESS 12)
		# needed for PRIVATE and PUBLIC flags in target_link_libraries
		# also in tests subdirectory
		# see also https://cmake.org/cmake/help/v3.0/policy/CMP0023.html
		remove_binding (glib "cmake 2.8.12 needed for glib")
		return ()
	endif ()
endif ()

find_package (PkgConfig)
pkg_check_modules (GOBJECT gobject-2.0>=2.36)

if (NOT GOBJECT_FOUND)
	exclude_binding (glib "No gobject found using pkg-config, also remove gi bindings because they depend on it")
else ()
	add_binding (glib)

	set (GELEKTRA_LIBRARY gelektra-${SO_VERSION}.0 CACHE INTERNAL "GELEKTRA_LIBRARY")

	file (GLOB GELEKTRA_HDR_FILES *.h)
	file (GLOB GELEKTRA_SRC_FILES *.c)
	add_headers (ELEKTRA_HEADERS)
	set (SOURCES ${GELEKTRA_SRC_FILES} ${GELEKTRA_HDR_FILES} ${ELEKTRA_HEADERS})

	add_library (${GELEKTRA_LIBRARY} SHARED ${SOURCES})
	add_dependencies (${GELEKTRA_LIBRARY} kdberrors_generated)

	target_include_directories (${GELEKTRA_LIBRARY} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
	target_include_directories (${GELEKTRA_LIBRARY} SYSTEM PUBLIC ${GOBJECT_INCLUDE_DIRS})

	target_compile_options (${GELEKTRA_LIBRARY} PUBLIC ${GOBJECT_CFLAGS_OTHER})
<commit_msg>Glib Bindings: Remove outdated CMake code<commit_after>include (LibAddMacros)

find_package (PkgConfig)
pkg_check_modules (GOBJECT gobject-2.0>=2.36)

if (NOT GOBJECT_FOUND)
	exclude_binding (glib "No gobject found using pkg-config, also remove gi bindings because they depend on it")
else ()
	add_binding (glib)

	set (GELEKTRA_LIBRARY gelektra-${SO_VERSION}.0 CACHE INTERNAL "GELEKTRA_LIBRARY")

	file (GLOB GELEKTRA_HDR_FILES *.h)
	file (GLOB GELEKTRA_SRC_FILES *.c)
	add_headers (ELEKTRA_HEADERS)
	set (SOURCES ${GELEKTRA_SRC_FILES} ${GELEKTRA_HDR_FILES} ${ELEKTRA_HEADERS})

	add_library (${GELEKTRA_LIBRARY} SHARED ${SOURCES})
	add_dependencies (${GELEKTRA_LIBRARY} kdberrors_generated)

	target_include_directories (${GELEKTRA_LIBRARY} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
	target_include_directories (${GELEKTRA_LIBRARY} SYSTEM PUBLIC ${GOBJECT_INCLUDE_DIRS})

	target_compile_options (${GELEKTRA_LIBRARY} PUBLIC ${GOBJECT_CFLAGS_OTHER})

{'fraction_non_alphanumeric': 0.09814563545906829, 'fraction_numerical': 0.011759384893713252, 'mean_word_length': 7.192592592592592, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5303112', 'n_tokens_mistral': 934, 'n_tokens_neox': 822, 'n_words': 182}