<commit_before>#
# Cmake module for Qore programming language
#
# (c) 2009 Qore Technologies, http://qoretechnologies.com
#
# QORE_FOUND - system has it
# QORE_INCLUDE_DIR 
# QORE_LIBRARY
# QORE_MODULES_DIR

SET(QORE_FOUND FALSE)


FIND_PATH (QORE_INCLUDE_DIR qore/Qore.h
    /usr/include
    /usr/include/qore
    /usr/local/include
    /usr/local/include/qore
    /opt/qore/include/qore
    /opt/qore/include
    ${QORE_INCLUDE_PATH}
)

FIND_LIBRARY (QORE_LIBRARY
    NAMES libqore libqore.so libqore.dylib
    PATHS 
      /usr/lib
      /usr/local/lib
	  /opt/qore/lib
	  ${QORE_LIBRARY_PATH}
    )

IF (QORE_LIBRARY AND QORE_INCLUDE_DIR)
    SET(QORE_LIBRARIES ${QORE_LIBRARY})
    SET(QORE_FOUND TRUE)
ENDIF (QORE_LIBRARY AND QORE_INCLUDE_DIR)


# get Qore version form 'qore --short-version' command etc
FIND_PROGRAM(QORE_EXECUTABLE NAMES qore DOC "Searching for qore executable")
IF (NOT QORE_EXECUTABLE)
    MESSAGE( FATAL_ERROR "Cannot find 'qore' executable. Check if it's in your PATH" )
ENDIF (NOT QORE_EXECUTABLE)


IF (QORE_MIN_VERSION)
    #now parse the parts of the user given version string into variables
    # qore version is taken from qore executable - format major.minor.patch-build
    STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" req_qore_version "${QORE_MIN_VERSION}")
    IF (NOT req_qore_version)
        MESSAGE( FATAL_ERROR "Invalid Qore version string given: \"${QORE_MIN_VERSION}\", expected e.g. \"0.7.3\"")
    ENDIF (NOT req_qore_version)
<commit_msg>FindQore.cmake unified accross modules<commit_after>#
# Cmake module for Qore programming language
#
# (c) 2009 Qore Technologies, http://qoretechnologies.com
#
# QORE_FOUND - system has it
# QORE_INCLUDE_DIR 
# QORE_LIBRARY
# QORE_MODULES_DIR
#
# QORE_EXECUTABLE
# QORE_QPP_EXECUTABLE
#

SET(QORE_FOUND FALSE)


MACRO (QORE_WRAP_QPP _cpp_files _inputs )
  message(STATUS "QPP: ${QORE_QPP_EXECUTABLE}")
  message(STATUS "QPP2: ${_inputs}")

  FOREACH (it ${_inputs})
    message(STATUS "QPP1: ${it}")
    GET_FILENAME_COMPONENT(_outfile ${it} NAME_WE)
    GET_FILENAME_COMPONENT(_infile ${it} ABSOLUTE)
    SET(_cppfile ${CMAKE_CURRENT_BINARY_DIR}/${_outfile}.cpp)
    SET(_doxfile ${CMAKE_CURRENT_BINARY_DIR}/${_outfile}.dox.h)
    message(STATUS "QPP processing: ${_infile} -> ${_cppfile} ${_doxfile}")
    ADD_CUSTOM_COMMAND(OUTPUT ${_cppfile} ${_doxfile}
      COMMAND ${QORE_QPP_EXECUTABLE}
      ARGS --output=${_cppfile} --dox-output=${_doxfile} ${_infile}
      MAIN_DEPENDENCY ${_infile}
      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
      )
    SET(${_cpp_files} ${${_cpp_files}} ${_cppfile})
  ENDFOREACH (it)

  message(STATUS "QPP files: ${${_cpp_files}}")

ENDMACRO (QORE_WRAP_QPP)



FIND_PATH (QORE_INCLUDE_DIR qore/Qore.h
    /usr/include
    /usr/include/qore
    /usr/local/include
    /usr/local/include/qore
    /opt/qore/include/qore
    /opt/qore/include
    ${QORE_INCLUDE_PATH}
)

FIND_LIBRARY (QORE_LIBRARY
    NAMES libqore libqore.so libqore.dylib
    PATHS 
      /usr/lib
      /usr/local/lib
	  /opt/qore/lib
	  ${QORE_LIBRARY_PATH}
    )

IF (QORE_LIBRARY AND QORE_INCLUDE_DIR)
    SET(QORE_LIBRARIES ${QORE_LIBRARY})
    SET(QORE_FOUND TRUE)
ENDIF (QORE_LIBRARY AND QORE_INCLUDE_DIR)


# get Qore version form 'qore --short-version' command etc
FIND_PROGRAM(QORE_EXECUTABLE NAMES qore DOC "Searching for qore executable")
IF (NOT QORE_EXECUTABLE)
    MESSAGE( FATAL_ERROR "Cannot find 'qore' executable. Check if it's in your PATH" )
ENDIF (NOT QORE_EXECUTABLE)

FIND_PROGRAM(QORE_QPP_EXECUTABLE NAMES qpp DOC "Searching for qore qpp preprocessor")
IF (NOT QORE_QPP_EXECUTABLE)
    MESSAGE( FATAL_ERROR "Cannot find 'qpp' executable. Check if it's in your PATH" )
ENDIF (NOT QORE_QPP_EXECUTABLE)


IF (QORE_MIN_VERSION)
    #now parse the parts of the user given version string into variables
    # qore version is taken from qore executable - format major.minor.patch-build
    STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" req_qore_version "${QORE_MIN_VERSION}")
    IF (NOT req_qore_version)
        MESSAGE( FATAL_ERROR "Invalid Qore version string given: \"${QORE_MIN_VERSION}\", expected e.g. \"0.7.3\"")
    ENDIF (NOT req_qore_version)

{'fraction_non_alphanumeric': 0.1138269829858615, 'fraction_numerical': 0.006709801102324467, 'mean_word_length': 4.047158403869408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2984876', 'n_tokens_mistral': 1771, 'n_tokens_neox': 1601, 'n_words': 357}