<commit_before>## Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.

cmake_minimum_required(VERSION 2.6.4)
project(ALMATH)
find_package(qibuild)

enable_testing()

# Add BEFORE keyword so that we can rebuild almath against a sdk
# without getting conflicts.
include_directories(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}")

set( ALMATH_SRCS
    src/dsp/digitalfilter.cpp
    src/dsp/pidcontroller.cpp
    src/geometrics/shapes3d.cpp
    src/geometrics/shapes3d_utils.cpp
    src/scenegraph/colladabuilder.cpp
    src/scenegraph/colladascenebuilder.cpp
    src/scenegraph/mesh.cpp
    src/scenegraph/meshfactory.cpp
    src/scenegraph/scenebuilder.cpp
    src/tools/avoidfootcollision.cpp
    src/tools/almath.cpp
    src/tools/almathio.cpp
    src/tools/aldubinscurve.cpp
    src/tools/altransformhelpers.cpp
    src/types/alaxismask.cpp
    src/types/alpose2d.cpp
    src/types/alrotation3d.cpp
    src/types/alrotation.cpp
    src/types/alpositionandvelocity.cpp
    src/types/altransformandvelocity6d.cpp
    src/types/altransform.cpp
    src/types/alvelocity3d.cpp
    src/types/alvelocity6d.cpp
    src/types/alposition2d.cpp
    src/types/alposition3d.cpp
    src/types/alposition6d.cpp
    src/types/alquaternion.cpp
    src/types/aldisplacement.cpp
)

# list of the public headers which are wrapped
# check it against swig -MM almath.i
set(ALMATH_H_WRAPPED
    almath/dsp/digitalfilter.h
    almath/dsp/pidcontroller.h
    almath/types/alaxismask.h
    almath/types/alpose2d.h
    almath/types/alposition2d.h
    almath/types/alposition3d.h
    almath/types/alposition6d.h
    almath/types/alpositionandvelocity.h
    almath/types/alquaternion.h
    almath/types/aldisplacement.h
    almath/types/alrotation.h
    almath/types/alrotation3d.h
    almath/types/altransform.h
    almath/types/alvelocity3d.h
    almath/types/alvelocity6d.h
    almath/types/altransformandvelocity6d.h
    almath/tools/aldubinscurve.h
    almath/tools/altrigonometry.h
    almath/tools/avoidfootcollision.h
    almath/tools/altransformhelpers.h
    almath/tools/almath.h
)
set(ALMATH_H
    ${ALMATH_H_WRAPPED}
    almath/geometrics/shapes3d.h
    almath/geometrics/shapes3d_utils.h
    almath/scenegraph/colladabuilder.h
    almath/scenegraph/colladascenebuilder.h
    almath/scenegraph/meshfactory.h
    almath/scenegraph/mesh.h
    almath/scenegraph/scenebuilder.h
    almath/tools/almathio.h
)
qi_create_lib(almath ${ALMATH_SRCS} ${ALMATH_H})
qi_use_lib(almath BOOST EIGEN3)

# we publish SWIG_MODULE_almathswig_DEPS together with the lib.
# It is useful when extending almathswig.
set(SWIG_MODULE_almathswig_DEPS "${CMAKE_CURRENT_SOURCE_DIR}/almath.i")
foreach(dep IN LISTS ALMATH_H_WRAPPED)
  list(APPEND SWIG_MODULE_almathswig_DEPS "${CMAKE_CURRENT_SOURCE_DIR}/${dep}")
endforeach()
qi_stage_lib(almath ALMATH
  CUSTOM_CODE
  "set(SWIG_MODULE_almathswig_DEPS \"${SWIG_MODULE_almathswig_DEPS}\" CACHE INTERNAL \"\" FORCE)")
qi_install_header(${ALMATH_H} KEEP_RELATIVE_PATHS)

qi_add_optional_package(PYTHON)
if(WITH_PYTHON)
  include(qibuild/swig/python)
  set(SWIG_MODULE_almathswig_EXTRA_DEPS ${ALMATH_H_WRAPPED})
  qi_swig_wrap_python(almathswig almath.i DEPENDS ALMATH)
  # we install the swig interface file since it is needed to wrap extensions
  # of almath, such as almathinternal.
  qi_install_header(almath.i KEEP_RELATIVE_PATHS)
  qi_install_python(almath.py)
endif()

add_subdirectory(test)<commit_msg>ALMath: expose the python module at build time too<commit_after>## Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.

cmake_minimum_required(VERSION 2.6.4)
project(ALMATH)
find_package(qibuild)

enable_testing()

# Add BEFORE keyword so that we can rebuild almath against a sdk
# without getting conflicts.
include_directories(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}")

set( ALMATH_SRCS
    src/dsp/digitalfilter.cpp
    src/dsp/pidcontroller.cpp
    src/geometrics/shapes3d.cpp
    src/geometrics/shapes3d_utils.cpp
    src/scenegraph/colladabuilder.cpp
    src/scenegraph/colladascenebuilder.cpp
    src/scenegraph/mesh.cpp
    src/scenegraph/meshfactory.cpp
    src/scenegraph/scenebuilder.cpp
    src/tools/avoidfootcollision.cpp
    src/tools/almath.cpp
    src/tools/almathio.cpp
    src/tools/aldubinscurve.cpp
    src/tools/altransformhelpers.cpp
    src/types/alaxismask.cpp
    src/types/alpose2d.cpp
    src/types/alrotation3d.cpp
    src/types/alrotation.cpp
    src/types/alpositionandvelocity.cpp
    src/types/altransformandvelocity6d.cpp
    src/types/altransform.cpp
    src/types/alvelocity3d.cpp
    src/types/alvelocity6d.cpp
    src/types/alposition2d.cpp
    src/types/alposition3d.cpp
    src/types/alposition6d.cpp
    src/types/alquaternion.cpp
    src/types/aldisplacement.cpp
)

# list of the public headers which are wrapped
# check it against swig -MM almath.i
set(ALMATH_H_WRAPPED
    almath/dsp/digitalfilter.h
    almath/dsp/pidcontroller.h
    almath/types/alaxismask.h
    almath/types/alpose2d.h
    almath/types/alposition2d.h
    almath/types/alposition3d.h
    almath/types/alposition6d.h
    almath/types/alpositionandvelocity.h
    almath/types/alquaternion.h
    almath/types/aldisplacement.h
    almath/types/alrotation.h
    almath/types/alrotation3d.h
    almath/types/altransform.h
    almath/types/alvelocity3d.h
    almath/types/alvelocity6d.h
    almath/types/altransformandvelocity6d.h
    almath/tools/aldubinscurve.h
    almath/tools/altrigonometry.h
    almath/tools/avoidfootcollision.h
    almath/tools/altransformhelpers.h
    almath/tools/almath.h
)
set(ALMATH_H
    ${ALMATH_H_WRAPPED}
    almath/geometrics/shapes3d.h
    almath/geometrics/shapes3d_utils.h
    almath/scenegraph/colladabuilder.h
    almath/scenegraph/colladascenebuilder.h
    almath/scenegraph/meshfactory.h
    almath/scenegraph/mesh.h
    almath/scenegraph/scenebuilder.h
    almath/tools/almathio.h
)
qi_create_lib(almath ${ALMATH_SRCS} ${ALMATH_H})
qi_use_lib(almath BOOST EIGEN3)

# we publish SWIG_MODULE_almathswig_DEPS together with the lib.
# It is useful when extending almathswig.
set(SWIG_MODULE_almathswig_DEPS "${CMAKE_CURRENT_SOURCE_DIR}/almath.i")
foreach(dep IN LISTS ALMATH_H_WRAPPED)
  list(APPEND SWIG_MODULE_almathswig_DEPS "${CMAKE_CURRENT_SOURCE_DIR}/${dep}")
endforeach()
qi_stage_lib(almath ALMATH
  CUSTOM_CODE
  "set(SWIG_MODULE_almathswig_DEPS \"${SWIG_MODULE_almathswig_DEPS}\" CACHE INTERNAL \"\" FORCE)")
qi_install_header(${ALMATH_H} KEEP_RELATIVE_PATHS)

qi_add_optional_package(PYTHON)
if(WITH_PYTHON)
  include(qibuild/swig/python)
  set(SWIG_MODULE_almathswig_EXTRA_DEPS ${ALMATH_H_WRAPPED})
  qi_swig_wrap_python(almathswig almath.i DEPENDS ALMATH)
  # we install the swig interface file since it is needed to wrap extensions
  # of almath, such as almathinternal.
  qi_install_header(almath.i KEEP_RELATIVE_PATHS)
  qi_install_python(almath.py)

  # Hack for the python interpreter to find the python module even at
  # build time, using qi::path::librariesPath().
  add_custom_target(copy-python-almath ALL
    COMMAND ${CMAKE_COMMAND}
    -E copy
    "${CMAKE_SOURCE_DIR}/almath.py"
    "${QI_SDK_DIR}/${QI_SDK_LIB}/almath.py"
  )
endif()

add_subdirectory(test)
{'fraction_non_alphanumeric': 0.08910352333015917, 'fraction_numerical': 0.007618011154944905, 'mean_word_length': 4.251428571428572, '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': '4574438', 'n_tokens_mistral': 2901, 'n_tokens_neox': 2794, 'n_words': 425}