<commit_before>#
# Find the MySQL client includes and library
# 

# This module defines
# MYSQL_VERSION     - The MySQL version
# MYSQL_INCLUDE_DIR - Where to find mysql.h
# MYSQL_LIBRARIES   - The libraries to link against to connect to MySQL
# MYSQL_LIBRARY     - Where to find the MySQL library (not for general use).
# MYSQL_FOUND       - If false, you cannot build anything that requires MySQL.

if (UNIX)
  set (MYSQL_CONFIG_PREFER_PATH "$ENV{MYSQL_HOME}/bin" CACHE FILEPATH
    "preferred path to MySQL (mysql_config)")

  find_program (MYSQL_CONFIG mysql_config
    ${MYSQL_CONFIG_PREFER_PATH}
    /usr/local/mysql/bin/
    /usr/local/bin/
    /usr/bin/)

  if (MYSQL_CONFIG)
    message (STATUS "Using mysql-config: ${MYSQL_CONFIG}")
    # Set VERSION
    exec_program (${MYSQL_CONFIG} ARGS --version OUTPUT_VARIABLE MY_TMP)
	set (MYSQL_VERSION ${MY_TMP})

    # Set INCLUDE_DIR
    exec_program (${MYSQL_CONFIG} ARGS --include OUTPUT_VARIABLE MY_TMP)

    string (REGEX REPLACE "-I([^ ]*)( .*)?" "\\1" MY_TMP "${MY_TMP}")
    set (MYSQL_ADD_INCLUDE_PATH ${MY_TMP} CACHE FILEPATH INTERNAL)
    #message("[DEBUG] MYSQL ADD_INCLUDE_PATH : ${MYSQL_ADD_INCLUDE_PATH}")
    # set LIBRARY_DIR
    exec_program (${MYSQL_CONFIG} ARGS --libs_r OUTPUT_VARIABLE MY_TMP)

    set (MYSQL_ADD_LIBRARIES "")
    string (REGEX MATCHALL "-l[^ ]*" MYSQL_LIB_LIST "${MY_TMP}")
    foreach (LIB ${MYSQL_LIB_LIST})
      string (REGEX REPLACE "[ ]*-l([^ ]*)" "\\1" LIB "${LIB}")
      list (APPEND MYSQL_ADD_LIBRARIES "${LIB}")
      #message("[DEBUG] MYSQL ADD_LIBRARIES : ${MYSQL_ADD_LIBRARIES}")
    endforeach (LIB ${MYSQL_LIB_LIST})<commit_msg>[CMake] Added default path for MySQL on MacOS<commit_after>#
# Find the MySQL client includes and library
# 

# This module defines
# MYSQL_VERSION     - The MySQL version
# MYSQL_INCLUDE_DIR - Where to find mysql.h
# MYSQL_LIBRARIES   - The libraries to link against to connect to MySQL
# MYSQL_LIBRARY     - Where to find the MySQL library (not for general use).
# MYSQL_FOUND       - If false, you cannot build anything that requires MySQL.

if (UNIX)
  set (MYSQL_CONFIG_PREFER_PATH "$ENV{MYSQL_HOME}/bin" CACHE FILEPATH
    "preferred path to MySQL (mysql_config)")

  find_program (MYSQL_CONFIG mysql_config
    ${MYSQL_CONFIG_PREFER_PATH}
    /usr/local/mysql/bin/
    /usr/local/bin/
    /usr/bin/
    /usr/local/opt/mysql-client/bin)

  if (MYSQL_CONFIG)
    message (STATUS "Using mysql-config: ${MYSQL_CONFIG}")
    # Set VERSION
    exec_program (${MYSQL_CONFIG} ARGS --version OUTPUT_VARIABLE MY_TMP)
	set (MYSQL_VERSION ${MY_TMP})

    # Set INCLUDE_DIR
    exec_program (${MYSQL_CONFIG} ARGS --include OUTPUT_VARIABLE MY_TMP)

    string (REGEX REPLACE "-I([^ ]*)( .*)?" "\\1" MY_TMP "${MY_TMP}")
    set (MYSQL_ADD_INCLUDE_PATH ${MY_TMP} CACHE FILEPATH INTERNAL)
    #message("[DEBUG] MYSQL ADD_INCLUDE_PATH : ${MYSQL_ADD_INCLUDE_PATH}")
    # set LIBRARY_DIR
    exec_program (${MYSQL_CONFIG} ARGS --libs_r OUTPUT_VARIABLE MY_TMP)

    set (MYSQL_ADD_LIBRARIES "")
    string (REGEX MATCHALL "-l[^ ]*" MYSQL_LIB_LIST "${MY_TMP}")
    foreach (LIB ${MYSQL_LIB_LIST})
      string (REGEX REPLACE "[ ]*-l([^ ]*)" "\\1" LIB "${LIB}")
      list (APPEND MYSQL_ADD_LIBRARIES "${LIB}")
      #message("[DEBUG] MYSQL ADD_LIBRARIES : ${MYSQL_ADD_LIBRARIES}")
    endforeach (LIB ${MYSQL_LIB_LIST})
{'fraction_non_alphanumeric': 0.12447636146020347, 'fraction_numerical': 0.0011968880909634949, 'mean_word_length': 3.86608442503639, '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': '7112119', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1243, 'n_words': 309}