<commit_before>cmake_minimum_required(VERSION 2.6)

include_directories(../../include)
include_directories(../cpp/bh)
include_directories(codegen/output/)

set(SRC ${CMAKE_CURRENT_SOURCE_DIR}/codegen/output/bh_c.h
        ${CMAKE_CURRENT_SOURCE_DIR}/codegen/output/bh_c_type_definitions.hpp
        ${CMAKE_CURRENT_SOURCE_DIR}/codegen/output/bh_c_implementation.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/codegen/output/bh_c_implementation_basics.cpp)

if(PYTHONINTERP_FOUND)

    file(GLOB DEPS codegen/templates/*.ctpl codegen/*.json codegen/*.py)
    add_custom_command(
      OUTPUT ${SRC}
      COMMAND ${PYTHON_EXECUTABLE} codegen/gen.py
      DEPENDS ${DEPS}  #TODO: gen.py writes a old timestamp thus this will always run
      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
    )<commit_msg>added PY_SCRIPT to the build script<commit_after>cmake_minimum_required(VERSION 2.6)

include_directories(../../include)
include_directories(../cpp/bh)
include_directories(codegen/output/)

set(SRC ${CMAKE_CURRENT_SOURCE_DIR}/codegen/output/bh_c.h
        ${CMAKE_CURRENT_SOURCE_DIR}/codegen/output/bh_c_type_definitions.hpp
        ${CMAKE_CURRENT_SOURCE_DIR}/codegen/output/bh_c_implementation.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/codegen/output/bh_c_implementation_basics.cpp)

    set(PY_SCRIPT ${PYTHON_EXECUTABLE} CACHE STRING "The Python interpreter to use for the build script and NOT the Python/NumPy Bridge")

if(PYTHONINTERP_FOUND)

    file(GLOB DEPS codegen/templates/*.ctpl codegen/*.json codegen/*.py)
    add_custom_command(
      OUTPUT ${SRC}
      COMMAND ${PY_SCRIPT} codegen/gen.py
      DEPENDS ${DEPS}  #TODO: gen.py writes a old timestamp thus this will always run
      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
    )
{'fraction_non_alphanumeric': 0.10429799426934097, 'fraction_numerical': 0.002292263610315186, 'mean_word_length': 4.596153846153846, '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': '4296959', 'n_tokens_mistral': 618, 'n_tokens_neox': 593, 'n_words': 97}