<commit_before>cmake_minimum_required (VERSION 2.8 FATAL_ERROR) # used to be version 3.1, but I don't know if that is really necessary
project (RFR CXX)

# add a version number
set (RFR_VERSION_MAJOR 0)
set (RFR_VERSION_MINOR 1)


IF(NOT CMAKE_BUILD_TYPE)
 SET(CMAKE_BUILD_TYPE "DEBUG")
 #SET(CMAKE_BUILD_TYPE "RELEASE")
 #SET(CMAKE_BUILD_TYPE "RELWITHDEBINFO")
 #SET(CMAKE_BUILD_TYPE "MINSIZEREL")
ENDIF()

enable_testing()

# required libaries
find_package(Boost COMPONENTS unit_test_framework REQUIRED)
find_package(Doxygen)

SET(Boost_USE_STATIC_LIBS OFF)
SET(Boost_USE_MULTITHREADED OFF)
SET(Boost_USE_STATIC_RUNTIME OFF)


# define all include directories within the project for different splits, data containers, node types etc...
include_directories ("${PROJECT_SOURCE_DIR}/include")
include_directories ("${Boost_INCLUDE_DIR}")

link_libraries(${Boost_LIBRARIES}) # Deprecated but so convenient!




# the documentation
if(DOXYGEN_FOUND)
	configure_file(${PROJECT_SOURCE_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
	add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
		WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
		COMMENT "Generating API documentation with Doxygen" VERBATIM)

endif(DOXYGEN_FOUND)



add_executable(profiling_example "${PROJECT_SOURCE_DIR}/tests/profiling_example.cpp")
set_property(TARGET profiling_example PROPERTY CXX_STANDARD 11)
set_property(TARGET profiling_example PROPERTY CXX_STANDARD_REQUIRED ON)



# the unit tests
add_executable(ut_data_containers "${PROJECT_SOURCE_DIR}/tests/unit_test_data_containers.cpp")
set_property(TARGET ut_data_containers PROPERTY CXX_STANDARD 11)
set_property(TARGET ut_data_containers PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(ut_data_containers ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (UTDataContainers ut_data_containers "${PROJECT_SOURCE_DIR}/test_data_sets/")
set_tests_properties (UTDataContainers PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")


add_executable(ut_binary_splits "${PROJECT_SOURCE_DIR}/tests/unit_test_binary_splits.cpp")
set_property(TARGET ut_binary_splits PROPERTY CXX_STANDARD 11)
set_property(TARGET ut_binary_splits PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(ut_binary_splits ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (UTBinarySplits ut_binary_splits "${PROJECT_SOURCE_DIR}/test_data_sets/")
set_tests_properties (UTBinarySplits PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")


add_executable(ut_binary_nodes "${PROJECT_SOURCE_DIR}/tests/unit_test_binary_nodes.cpp")
set_property(TARGET ut_binary_nodes PROPERTY CXX_STANDARD 11)
set_property(TARGET ut_binary_nodes PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(ut_binary_nodes ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (UTBinaryNodes ut_binary_nodes "${PROJECT_SOURCE_DIR}/test_data_sets/")
set_tests_properties (UTBinaryNodes PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")


add_executable(ut_binary_trees "${PROJECT_SOURCE_DIR}/tests/unit_test_binary_tree.cpp")
set_property(TARGET ut_binary_trees PROPERTY CXX_STANDARD 11)
set_property(TARGET ut_binary_trees PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(ut_binary_trees ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (UTBinaryTrees ut_binary_trees "${PROJECT_SOURCE_DIR}/test_data_sets/")
set_tests_properties (UTBinaryTrees PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")


add_executable(ut_regression_forest "${PROJECT_SOURCE_DIR}/tests/unit_test_regression_forest.cpp")
set_property(TARGET ut_regression_forest PROPERTY CXX_STANDARD 11)
set_property(TARGET ut_regression_forest PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(ut_regression_forest ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (UTRegressionForest ut_regression_forest "${PROJECT_SOURCE_DIR}/test_data_sets/")
set_tests_properties (UTRegressionForest PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")


add_executable(ut_utils "${PROJECT_SOURCE_DIR}/tests/unit_test_utils.cpp")
set_property(TARGET ut_utils PROPERTY CXX_STANDARD 11)
set_property(TARGET ut_utils PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(ut_utils ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (UTUtils ut_utils)
set_tests_properties (UTUtils PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")

#add_executable(ut_classification_forest "${PROJECT_SOURCE_DIR}/tests/unit_test_classification_forest.cpp")
#set_property(TARGET ut_classification_forest PROPERTY CXX_STANDARD 11)
#set_property(TARGET ut_classification_forest PROPERTY CXX_STANDARD_REQUIRED ON)
#target_link_libraries(ut_classification_forest ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

#add_test (UTClassificationForest ut_classification_forest "${PROJECT_SOURCE_DIR}/test_data_sets/")
#set_tests_properties (UTClassificationForest PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")




IF(CMAKE_COMPILER_IS_GNUCXX)
  ADD_DEFINITIONS("-Wall -fPIC -pg")
  #ADD_DEFINITIONS("-fPIC")
 ELSE()
  MESSAGE(FATAL_ERROR "CMakeLists.txt has not been tested/written for your compiler.")
ENDIF()
<commit_msg>added building the python module to the unittests if python is installed<commit_after>cmake_minimum_required (VERSION 2.8 FATAL_ERROR) # used to be version 3.1, but I don't know if that is really necessary
project (RFR CXX)

# add a version number
set (RFR_VERSION_MAJOR 0)
set (RFR_VERSION_MINOR 1)


IF(NOT CMAKE_BUILD_TYPE)
 SET(CMAKE_BUILD_TYPE "DEBUG")
 #SET(CMAKE_BUILD_TYPE "RELEASE")
 #SET(CMAKE_BUILD_TYPE "RELWITHDEBINFO")
 #SET(CMAKE_BUILD_TYPE "MINSIZEREL")
ENDIF()

enable_testing()

# required libaries
find_package(Boost COMPONENTS unit_test_framework REQUIRED)
find_package(Doxygen)
find_package(PythonInterp)

SET(Boost_USE_STATIC_LIBS OFF)
SET(Boost_USE_MULTITHREADED OFF)
SET(Boost_USE_STATIC_RUNTIME OFF)


# define all include directories within the project for different splits, data containers, node types etc...
include_directories ("${PROJECT_SOURCE_DIR}/include")
include_directories ("${Boost_INCLUDE_DIR}")

link_libraries(${Boost_LIBRARIES}) # Deprecated but so convenient!




# the documentation
if(DOXYGEN_FOUND)
	configure_file(${PROJECT_SOURCE_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
	add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
		WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
		COMMENT "Generating API documentation with Doxygen" VERBATIM)

endif(DOXYGEN_FOUND)



add_executable(profiling_example "${PROJECT_SOURCE_DIR}/tests/profiling_example.cpp")
set_property(TARGET profiling_example PROPERTY CXX_STANDARD 11)
set_property(TARGET profiling_example PROPERTY CXX_STANDARD_REQUIRED ON)



# the unit tests
add_executable(ut_data_containers "${PROJECT_SOURCE_DIR}/tests/unit_test_data_containers.cpp")
set_property(TARGET ut_data_containers PROPERTY CXX_STANDARD 11)
set_property(TARGET ut_data_containers PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(ut_data_containers ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (UTDataContainers ut_data_containers "${PROJECT_SOURCE_DIR}/test_data_sets/")
set_tests_properties (UTDataContainers PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")


add_executable(ut_binary_splits "${PROJECT_SOURCE_DIR}/tests/unit_test_binary_splits.cpp")
set_property(TARGET ut_binary_splits PROPERTY CXX_STANDARD 11)
set_property(TARGET ut_binary_splits PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(ut_binary_splits ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (UTBinarySplits ut_binary_splits "${PROJECT_SOURCE_DIR}/test_data_sets/")
set_tests_properties (UTBinarySplits PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")


add_executable(ut_binary_nodes "${PROJECT_SOURCE_DIR}/tests/unit_test_binary_nodes.cpp")
set_property(TARGET ut_binary_nodes PROPERTY CXX_STANDARD 11)
set_property(TARGET ut_binary_nodes PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(ut_binary_nodes ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (UTBinaryNodes ut_binary_nodes "${PROJECT_SOURCE_DIR}/test_data_sets/")
set_tests_properties (UTBinaryNodes PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")


add_executable(ut_binary_trees "${PROJECT_SOURCE_DIR}/tests/unit_test_binary_tree.cpp")
set_property(TARGET ut_binary_trees PROPERTY CXX_STANDARD 11)
set_property(TARGET ut_binary_trees PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(ut_binary_trees ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (UTBinaryTrees ut_binary_trees "${PROJECT_SOURCE_DIR}/test_data_sets/")
set_tests_properties (UTBinaryTrees PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")


add_executable(ut_regression_forest "${PROJECT_SOURCE_DIR}/tests/unit_test_regression_forest.cpp")
set_property(TARGET ut_regression_forest PROPERTY CXX_STANDARD 11)
set_property(TARGET ut_regression_forest PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(ut_regression_forest ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (UTRegressionForest ut_regression_forest "${PROJECT_SOURCE_DIR}/test_data_sets/")
set_tests_properties (UTRegressionForest PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")


add_executable(ut_utils "${PROJECT_SOURCE_DIR}/tests/unit_test_utils.cpp")
set_property(TARGET ut_utils PROPERTY CXX_STANDARD 11)
set_property(TARGET ut_utils PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(ut_utils ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

add_test (UTUtils ut_utils)
#set_tests_properties (UTUtils PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")


if(PYTHONINTERP_FOUND)
	add_test(	NAME BuildPyRFR
				COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/setup.py build_ext --force --inplace
				WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
endif(PYTHONINTERP_FOUND)



#add_executable(ut_classification_forest "${PROJECT_SOURCE_DIR}/tests/unit_test_classification_forest.cpp")
#set_property(TARGET ut_classification_forest PROPERTY CXX_STANDARD 11)
#set_property(TARGET ut_classification_forest PROPERTY CXX_STANDARD_REQUIRED ON)
#target_link_libraries(ut_classification_forest ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

#add_test (UTClassificationForest ut_classification_forest "${PROJECT_SOURCE_DIR}/test_data_sets/")
#set_tests_properties (UTClassificationForest PROPERTIES PASS_REGULAR_EXPRESSION "No errors detected")




IF(CMAKE_COMPILER_IS_GNUCXX)
  ADD_DEFINITIONS("-Wall -fPIC -pg")
  #ADD_DEFINITIONS("-fPIC")
 ELSE()
  MESSAGE(FATAL_ERROR "CMakeLists.txt has not been tested/written for your compiler.")
ENDIF()

{'fraction_non_alphanumeric': 0.07382678367035482, 'fraction_numerical': 0.004196871423120946, 'mean_word_length': 10.794150731158606, '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': '452599', 'n_tokens_mistral': 3785, 'n_tokens_neox': 3543, 'n_words': 633}