<commit_before>cmake_minimum_required(VERSION 2.8)
message( "\nConfiguring python wrapper:" )

# dependencies
find_package( Boost REQUIRED COMPONENTS python serialization )
find_package( PythonLibs REQUIRED )
find_package( PythonInterp REQUIRED )

include_directories( ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} )

# pypgmlink
set(PYPGMLINK_SRCS
  pyfield_of_view.cpp
  pyhypotheses.cpp
  pypgmlink.cpp
  pytrack.cpp
  pytraxels.cpp
  )

add_library(pypgmlink SHARED ${PYPGMLINK_SRCS})
target_link_libraries(pypgmlink pgmlink ${Boost_LIBRARIES} )
set_target_properties(pypgmlink PROPERTIES PREFIX "" OUTPUT_NAME "pgmlink")

# install

# this will set the install dir to $PYTHON_SITE_PACKAGES
# make use of ${PYTHON_EXECUTABLE} instead of /usr/bin/python
if(NOT DEFINED PYPGMLINK_INSTALL_DIR OR PYPGMLINK_INSTALL_DIR MATCHES "^$")
    execute_process(COMMAND ${PYTHON_EXECUTABLE} -c 
                    "from distutils.sysconfig import *; print get_python_lib(1)"
                    OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
    file(TO_CMAKE_PATH ${PYTHON_SITE_PACKAGES} PYPGMLINK_INSTALL_DIR)
endif()
set(PYPGMLINK_INSTALL_DIR ${PYPGMLINK_INSTALL_DIR}
    CACHE PATH "where to install the pgmlink Python package" FORCE)

# this is the install path relative to CMAKE_INSTALL_PREFIX,<commit_msg>win32: find python manually<commit_after>cmake_minimum_required(VERSION 2.8)
message( "\nConfiguring python wrapper:" )

# dependencies
find_package( Boost REQUIRED COMPONENTS python serialization )
if(WIN32)
  set(PYTHON_EXECUTABLE "" CACHE PATH "")
  set(PYTHON_INCLUDE_DIRS "" CACHE PATH "")
else()
  find_package( PythonLibs REQUIRED )
  find_package( PythonInterp REQUIRED )
endif()

include_directories( ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} )

# pypgmlink
set(PYPGMLINK_SRCS
  pyfield_of_view.cpp
  pyhypotheses.cpp
  pypgmlink.cpp
  pytrack.cpp
  pytraxels.cpp
  )

add_library(pypgmlink SHARED ${PYPGMLINK_SRCS})
target_link_libraries(pypgmlink pgmlink ${Boost_LIBRARIES} )
set_target_properties(pypgmlink PROPERTIES PREFIX "" OUTPUT_NAME "pgmlink")

# install

# this will set the install dir to $PYTHON_SITE_PACKAGES
# make use of ${PYTHON_EXECUTABLE} instead of /usr/bin/python
if(NOT DEFINED PYPGMLINK_INSTALL_DIR OR PYPGMLINK_INSTALL_DIR MATCHES "^$")
    execute_process(COMMAND ${PYTHON_EXECUTABLE} -c 
                    "from distutils.sysconfig import *; print get_python_lib(1)"
                    OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
    file(TO_CMAKE_PATH ${PYTHON_SITE_PACKAGES} PYPGMLINK_INSTALL_DIR)
endif()
set(PYPGMLINK_INSTALL_DIR ${PYPGMLINK_INSTALL_DIR}
    CACHE PATH "where to install the pgmlink Python package" FORCE)

# this is the install path relative to CMAKE_INSTALL_PREFIX,
{'fraction_non_alphanumeric': 0.07581746316924183, 'fraction_numerical': 0.0035932446999640674, 'mean_word_length': 5.676258992805756, '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': '1032901', 'n_tokens_mistral': 1085, 'n_tokens_neox': 1010, 'n_words': 205}