<commit_before>project(libvarbit)
cmake_minimum_required (VERSION 2.8)

# settings
set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -Wformat=2 -Wold-style-cast -Winit-self -Wmissing-include-dirs -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings")

# headers
install(
	DIRECTORY include/
	DESTINATION include/varbit)

# tests
enable_testing(true)
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS} include)
aux_source_directory(test test_sources)
add_executable(tests ${test_sources})
target_link_libraries(tests ${GTEST_BOTH_LIBRARIES})
GTEST_ADD_TESTS(tests "" ${test_sources})

# benchmarks
include(CheckIncludeFileCXX)
check_include_file_cxx(papi.h PFUNC_HAVE_PAPI_H)
if(PFUNC_HAVE_PAPI_H)
	include_directories(. include)
	aux_source_directory(benchmark benchmark_sources)
	foreach(source_filename ${benchmark_sources})
		string(REGEX REPLACE "benchmark/(.*).cc" "\\1"
			binary_filename ${source_filename})
		add_executable("benchmark_${binary_filename}" ${source_filename})
	endforeach()
else()
	message("Benchmarks disabled as papi.h was not found.")
endif()

# style
add_custom_target(style
	python tools/cpplint.py
	--filter=-legal,-readability/streams,-build/header_guard
	benchmark/* include/* test/*
	WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})<commit_msg>Fixed CMake to compile on Linux<commit_after>project(libvarbit)
cmake_minimum_required (VERSION 2.8)

# settings
set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -Wformat=2 -Wold-style-cast -Winit-self -Wmissing-include-dirs -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings")

# headers
install(
	DIRECTORY include/
	DESTINATION include/varbit)


# tests
enable_testing(true)
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS} include)
aux_source_directory(test test_sources)
add_executable(tests ${test_sources})
target_link_libraries(tests ${GTEST_BOTH_LIBRARIES} pthread)
GTEST_ADD_TESTS(tests "" ${test_sources})

# benchmarks
include(CheckIncludeFileCXX)
check_include_file_cxx(papi.h PFUNC_HAVE_PAPI_H)
if(PFUNC_HAVE_PAPI_H)
	include_directories(. include)
	aux_source_directory(benchmark benchmark_sources)
	foreach(source_filename ${benchmark_sources})
		string(REGEX REPLACE "benchmark/(.*).cc" "\\1"
			binary_filename ${source_filename})
		add_executable("benchmark_${binary_filename}" ${source_filename})
	endforeach()
	target_link_libraries("benchmark_${binary_filename}" "-lpapi -lpthread")
else()
	message("Benchmarks disabled as papi.h was not found.")
endif()

# style
add_custom_target(style
	python tools/cpplint.py
	--filter=-legal,-readability/streams,-build/header_guard
	benchmark/* include/* test/*
	WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})

{'fraction_non_alphanumeric': 0.11515378844711177, 'fraction_numerical': 0.0037509377344336083, 'mean_word_length': 7.631067961165049, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2302755', 'n_tokens_mistral': 966, 'n_tokens_neox': 926, 'n_words': 160}