<commit_before>#
# Copyright (c) 2014-2020 CNRS INRIA
#

# --- LIBRARY --- #
SET(PYWRAP ${PROJECT_NAME}_pywrap) 
SET(PYWRAP ${PYWRAP} PARENT_SCOPE)

MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/python/${PROJECT_NAME}")

ADD_CUSTOM_TARGET(python)
SET_TARGET_PROPERTIES(python PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True)

ADD_LIBRARY(${PYWRAP} SHARED main.cpp)
ADD_DEPENDENCIES(python ${PYWRAP})
TARGET_LINK_LIBRARIES(${PYWRAP} PUBLIC ${PROJECT_NAME}) 
# BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS spews conversion warnings from int to long unsigned int.
# Unfortunately, using literals does not work in a macro. As such, this turns them off for the entire wrapper:
IF(NOT WIN32)
  TARGET_COMPILE_OPTIONS(${PYWRAP} PRIVATE "-Wno-conversion")
ENDIF()
IF(IS_ABSOLUTE ${PYTHON_SITELIB})
  SET(${PYWRAP}_INSTALL_DIR ${PYTHON_SITELIB}/${PROJECT_NAME})
ELSE()
  SET(${PYWRAP}_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITELIB}/${PROJECT_NAME})
ENDIF()

SET_TARGET_PROPERTIES(${PYWRAP}
  PROPERTIES 
  PREFIX ""
  SUFFIX ${PYTHON_EXT_SUFFIX}
  OUTPUT_NAME "${PROJECT_NAME}"
  LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python/${PROJECT_NAME}"
  )

INSTALL(TARGETS ${PYWRAP} DESTINATION ${${PYWRAP}_INSTALL_DIR})

# --- INSTALL SCRIPTS 
SET(PYTHON_FILES
  __init__.py
  )

FOREACH(python ${PYTHON_FILES})
  INSTALL(FILES
    "${CMAKE_CURRENT_SOURCE_DIR}/eigenpy/${python}"
    DESTINATION ${${PYWRAP}_INSTALL_DIR})
ENDFOREACH(python)
<commit_msg>[CMake] set INSTALL_RPATH for python on linux<commit_after>#
# Copyright (c) 2014-2021 CNRS INRIA
#

# --- LIBRARY --- #
SET(PYWRAP ${PROJECT_NAME}_pywrap) 
SET(PYWRAP ${PYWRAP} PARENT_SCOPE)

MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/python/${PROJECT_NAME}")

ADD_CUSTOM_TARGET(python)
SET_TARGET_PROPERTIES(python PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True)

ADD_LIBRARY(${PYWRAP} SHARED main.cpp)
ADD_DEPENDENCIES(python ${PYWRAP})
TARGET_LINK_LIBRARIES(${PYWRAP} PUBLIC ${PROJECT_NAME}) 
# BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS spews conversion warnings from int to long unsigned int.
# Unfortunately, using literals does not work in a macro. As such, this turns them off for the entire wrapper:
IF(NOT WIN32)
  TARGET_COMPILE_OPTIONS(${PYWRAP} PRIVATE "-Wno-conversion")
ENDIF()
IF(IS_ABSOLUTE ${PYTHON_SITELIB})
  SET(${PYWRAP}_INSTALL_DIR ${PYTHON_SITELIB}/${PROJECT_NAME})
ELSE()
  SET(${PYWRAP}_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITELIB}/${PROJECT_NAME})
ENDIF()

SET_TARGET_PROPERTIES(${PYWRAP}
  PROPERTIES 
  PREFIX ""
  SUFFIX ${PYTHON_EXT_SUFFIX}
  OUTPUT_NAME "${PROJECT_NAME}"
  LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python/${PROJECT_NAME}"
  )

IF(UNIX AND NOT APPLE)
  SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES INSTALL_RPATH "\$ORIGIN/../../..")
ENDIF()

INSTALL(TARGETS ${PYWRAP} DESTINATION ${${PYWRAP}_INSTALL_DIR})

# --- INSTALL SCRIPTS 
SET(PYTHON_FILES
  __init__.py
  )

FOREACH(python ${PYTHON_FILES})
  INSTALL(FILES
    "${CMAKE_CURRENT_SOURCE_DIR}/eigenpy/${python}"
    DESTINATION ${${PYWRAP}_INSTALL_DIR})
ENDFOREACH(python)

{'fraction_non_alphanumeric': 0.13368630046326935, 'fraction_numerical': 0.0066181336863004635, 'mean_word_length': 6.9762532981530345, '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': '4113945', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1182, 'n_words': 201}