<commit_before># - Try to find a version of Matlab and headers/library required by the 
#   used compiler. It determines the right MEX-File extension and add 
#   a macro to help the build of MEX-functions.
#
# For Windows, this module detects a Matlab's version between Matlab 7.0 
# (R14) and Matlab 7.9 (r2009b). 
# The Unix part of this module doesn't detect the Matlab version. To use it,
# it is necessary to set the MATLAB_ROOT with the path of the Matlab
# installation.
#
# This module defines: 
#  MATLAB_ROOT: Matlab installation path
#  MATLAB_INCLUDE_DIR: include path for mex.h, engine.h
#  MATLAB_MEX_LIBRARY: path to libmex.lib
#  MATLAB_MX_LIBRARY:  path to libmx.lib
#  MATLAB_ENG_LIBRARY: path to libeng.lib
#  MATLAB_LIBRARIES:   required libraries: libmex, libmx, libeng
#  MATLAB_MEXFILE_EXT: MEX extension required for the current plateform
#  MATLAB_CREATE_MEX: macro to build a MEX-file
#
# The macro MATLAB_CREATE_MEX requires in this order:
#  - function's name which will be called in Matlab;
#  - C/C++ source files;
#  - third libraries required.

# Copyright (c) 2009-2010 <NAME> <<EMAIL>>
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

IF(MATLAB_ROOT AND MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
   # in cache already
   SET(Matlab_FIND_QUIETLY TRUE)
ENDIF(MATLAB_ROOT AND MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)

IF(WIN32)
  SET(MATLAB_PATHS 
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.10;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.9;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.8;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.7;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.6;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.5;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.4;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.3;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.2;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.1;MATLABROOT]"
  )
  FIND_PATH(MATLAB_ROOT "license.txt" ${MATLAB_PATHS} NO_DEFAULT_PATH)
  IF (NOT MATLAB_ROOT)
    FIND_PATH(MATLAB_ROOT "license.txt" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]" NO_DEFAULT_PATH)
    IF (MATLAB_ROOT)
      SET(MATLAB_OLD_WIN_MEXFILE_EXT 1 CACHE STRING "Old MEX extension for Windows")
    ENDIF (MATLAB_ROOT)
  ENDIF (NOT MATLAB_ROOT)
  #MESSAGE(STATUS "MATLAB_ROOT: ${MATLAB_ROOT}")
  #MESSAGE(STATUS "MATLAB_OLD_WIN_MEXFILE_EXT: ${MATLAB_OLD_WIN_MEXFILE_EXT}")
  
  SET(MATLAB_LIBRARIES_PATHS
      "${MATLAB_ROOT}/extern/lib/win64/microsoft"
      "${MATLAB_ROOT}/extern/lib/win32/microsoft"
      "${MATLAB_ROOT}/extern/lib/win32/microsoft/msvc71")
  SET(MATLAB_INCLUDE_PATHS "${MATLAB_ROOT}/extern/include")

  # MEX files extension
  IF(CMAKE_CXX_COMPILER MATCHES "^.*cl.exe$" OR CMAKE_CXX_COMPILER MATCHES "^.*cl$")
    IF(MATLAB_OLD_WIN_MEXFILE_EXT)
      SET(MATLAB_MEXFILE_EXT dll)
    ELSE(MATLAB_OLD_WIN_MEXFILE_EXT)
      IF(CMAKE_CL_64)
        SET(MATLAB_MEXFILE_EXT mexw64)
      ELSE(CMAKE_CL_64)
        SET(MATLAB_MEXFILE_EXT mexw32)
      ENDIF(CMAKE_CL_64)
    ENDIF (MATLAB_OLD_WIN_MEXFILE_EXT)
  ELSE(CMAKE_CXX_COMPILER MATCHES "^.*cl.exe$" OR CMAKE_CXX_COMPILER MATCHES "^.*cl$")
    MESSAGE(FATAL_ERROR "Matlab Mex files are only supported by MS Visual Studio")
  ENDIF(CMAKE_CXX_COMPILER MATCHES "^.*cl.exe$" OR CMAKE_CXX_COMPILER MATCHES "^.*cl$")
  #MESSAGE(STATUS "MATLAB_MEXFILE_EXT: ${MATLAB_MEXFILE_EXT}")

  # LIBMEX, LIBMX, LIBENG names
  SET(LIBMEX "libmex")
  SET(LIBMX "libmx")
  SET(LIBENG "libeng")
ELSE(WIN32)
  # MEX files extension
  IF(APPLE)
    FILE(GLOB MATLAB_PATHS "/Applications/MATLAB_*")
    FIND_PATH(MATLAB_ROOT "license.txt" ${MATLAB_PATHS})
    IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
      SET(MBITS 32)<commit_msg>[UPD] Should be able to compile BTK with Matlab 6.5<commit_after># - Try to find a version of Matlab and headers/library required by the 
#   used compiler. It determines the right MEX-File extension and add 
#   a macro to help the build of MEX-functions.
#
# This module detects a Matlab's version between Matlab 7.0 (R14)
# and Matlab 7.9 (r2009b).
#
# This module defines: 
#  MATLAB_ROOT: Matlab installation path
#  MATLAB_INCLUDE_DIR: include path for mex.h, engine.h
#  MATLAB_MEX_LIBRARY: path to libmex.lib
#  MATLAB_MX_LIBRARY:  path to libmx.lib
#  MATLAB_ENG_LIBRARY: path to libeng.lib
#  MATLAB_LIBRARIES:   required libraries: libmex, libmx, libeng
#  MATLAB_MEXFILE_EXT: MEX extension required for the current plateform
#  MATLAB_CREATE_MEX: macro to build a MEX-file
#
# The macro MATLAB_CREATE_MEX requires in this order:
#  - function's name which will be called in Matlab;
#  - C/C++ source files;
#  - third libraries required.

# Copyright (c) 2009-2010 <NAME> <<EMAIL>>
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

IF(MATLAB_ROOT AND MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
   # in cache already
   SET(Matlab_FIND_QUIETLY TRUE)
ENDIF(MATLAB_ROOT AND MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)

IF(WIN32)
  SET(MATLAB_PATHS 
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.10;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.9;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.8;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.7;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.6;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.5;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.4;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.3;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.2;MATLABROOT]"
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.1;MATLABROOT]"
  )
  FIND_PATH(MATLAB_ROOT "license.txt" ${MATLAB_PATHS} NO_DEFAULT_PATH)
  IF (NOT MATLAB_ROOT)
    SET(MATLAB_PATHS 
      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]"
      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\6.5;MATLABROOT]"
    )
    FIND_PATH(MATLAB_ROOT "license.txt" ${MATLAB_PATHS} NO_DEFAULT_PATH)
    IF (MATLAB_ROOT)
      SET(MATLAB_OLD_WIN_MEXFILE_EXT 1 CACHE STRING "Old MEX extension for Windows")
    ENDIF (MATLAB_ROOT)
  ENDIF (NOT MATLAB_ROOT)
  #MESSAGE(STATUS "MATLAB_ROOT: ${MATLAB_ROOT}")
  #MESSAGE(STATUS "MATLAB_OLD_WIN_MEXFILE_EXT: ${MATLAB_OLD_WIN_MEXFILE_EXT}")
  
  SET(MATLAB_LIBRARIES_PATHS
      "${MATLAB_ROOT}/extern/lib/win64/microsoft"
      "${MATLAB_ROOT}/extern/lib/win32/microsoft"
      "${MATLAB_ROOT}/extern/lib/win32/microsoft/msvc70"
      "${MATLAB_ROOT}/extern/lib/win32/microsoft/msvc71")
  SET(MATLAB_INCLUDE_PATHS "${MATLAB_ROOT}/extern/include")

  # MEX files extension
  IF(CMAKE_CXX_COMPILER MATCHES "^.*cl.exe$" OR CMAKE_CXX_COMPILER MATCHES "^.*cl$")
    IF(MATLAB_OLD_WIN_MEXFILE_EXT)
      SET(MATLAB_MEXFILE_EXT dll)
    ELSE(MATLAB_OLD_WIN_MEXFILE_EXT)
      IF(CMAKE_CL_64)
        SET(MATLAB_MEXFILE_EXT mexw64)
      ELSE(CMAKE_CL_64)
        SET(MATLAB_MEXFILE_EXT mexw32)
      ENDIF(CMAKE_CL_64)
    ENDIF (MATLAB_OLD_WIN_MEXFILE_EXT)
  ELSE(CMAKE_CXX_COMPILER MATCHES "^.*cl.exe$" OR CMAKE_CXX_COMPILER MATCHES "^.*cl$")
    MESSAGE(FATAL_ERROR "Matlab Mex files are only supported by MS Visual Studio")
  ENDIF(CMAKE_CXX_COMPILER MATCHES "^.*cl.exe$" OR CMAKE_CXX_COMPILER MATCHES "^.*cl$")
  #MESSAGE(STATUS "MATLAB_MEXFILE_EXT: ${MATLAB_MEXFILE_EXT}")

  # LIBMEX, LIBMX, LIBENG names
  SET(LIBMEX "libmex")
  SET(LIBMX "libmx")
  SET(LIBENG "libeng")
ELSE(WIN32)
  # MEX files extension
  IF(APPLE)
    FILE(GLOB MATLAB_PATHS "/Applications/MATLAB_*")
    FIND_PATH(MATLAB_ROOT "license.txt" ${MATLAB_PATHS})
    IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
      SET(MBITS 32)
{'fraction_non_alphanumeric': 0.11611138736946792, 'fraction_numerical': 0.017652909000497267, 'mean_word_length': 4.465353260869565, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6399658', 'n_tokens_mistral': 3383, 'n_tokens_neox': 3082, 'n_words': 600}