<commit_before>include_directories (${PROJECT_SOURCE_DIR}/util tinyxml)
# IMPORTANT NOTE!!
# matlab has it's own boost libraries.  DO NOT let any mex file depend
# on the system boost (directly nor indirectly), or you're asking for trouble.

include_directories(joints)
include_directories(${PROJECT_SOURCE_DIR}/solvers)

add_library(drakeRBM SHARED RigidBodyManipulator.cpp RigidBody.cpp RigidBodyManipulatorURDF.cpp RigidBodyManipulatorContact.cpp tinyxml/tinyxml.cpp tinyxml/tinyxmlparser.cpp tinyxml/tinyxmlerror.cpp)
target_link_libraries(drakeRBM drakeCollision drakeJoints spruce drakeUtil)
pods_install_libraries(drakeRBM)
pods_install_headers(RigidBodyManipulator.h RigidBody.h RigidBodyFrame.h KinematicPath.h KinematicsCache.h ForceTorqueMeasurement.h DESTINATION drake)
pods_install_pkg_config_file(drake-rbm
  LIBS -ldrakeRBM -ldrakeCollision -ldrakeJoints -lspruce -ldrakeUtil
  REQUIRES
  VERSION 0.0.1)

pods_find_pkg_config(gurobi)
pods_find_pkg_config(snopt_c)
add_subdirectory(shapes)
add_subdirectory(collision)
add_subdirectory(constraint)
add_subdirectory(joints)

add_subdirectory(viewer)

if (MATLAB_FOUND)
  macro(add_rbm_mex)
    # todo: use this again once I can assume everyone has CMAKE version >= 2.8.8
#    add_mex(${ARGV} ${ARGV}.cpp $<TARGET_OBJECTS:drakeUtil>)
#    target_link_libraries(${ARGV} drakeRBM)
    add_mex(${ARGV} ${ARGV}.cpp)
    target_link_libraries(${ARGV} drakeRBM drakeMexUtil)
  endmacro()

  add_rbm_mex(constructModelmex)
  add_rbm_mex(collisionDetectmex)
  add_rbm_mex(smoothDistancePenaltymex)
  add_rbm_mex(collisionRaycastmex)
  add_rbm_mex(allCollisionsmex)
  add_rbm_mex(findKinematicPathmex)
  target_link_libraries(findKinematicPathmex drakeUtil)
  add_rbm_mex(geometricJacobianmex)
  target_link_libraries(geometricJacobianmex drakeUtil)
  add_rbm_mex(doKinematicsmex)
  add_rbm_mex(forwardKinmex)
  add_rbm_mex(forwardKinPositionGradientmex)
  add_rbm_mex(centerOfMassmex)
  add_rbm_mex(centroidalMomentumMatrixmex)
  add_rbm_mex(massMatrixmex)
  add_rbm_mex(inverseDynamicsmex)
  add_rbm_mex(geometricJacobianDotTimesVmex)
  add_rbm_mex(centroidalMomentumMatrixDotTimesVmex)
  add_rbm_mex(centerOfMassJacobianDotTimesVmex)
  add_rbm_mex(forwardJacDotTimesVmex)
  add_rbm_mex(contactConstraintsmex)
  add_rbm_mex(surfaceTangentsmex)
  add_rbm_mex(jointLimitConstraintsmex)
  add_rbm_mex(positionConstraintsmex)
  add_rbm_mex(testFrameParsermex)
  add_rbm_mex(computeS1Trajmex)
  add_rbm_mex(createKinematicsCachemex)
  target_link_libraries(computeS1Trajmex drakeZMPUtil)

  if(gurobi_FOUND)
    add_definitions(-DPATHLCP_MEXFILE=\"${PROJECT_SOURCE_DIR}/thirdParty/path/lcppath.${MEX_EXT}\")
    add_mex(solveLCPmex solveLCPmex.cpp)
    target_link_libraries(solveLCPmex drakeRBM drakeMexUtil drakeQP)
  endif()
endif(MATLAB_FOUND)

include_directories( constraint )
add_library(drakeIKoptions SHARED IKoptions.cpp)
target_link_libraries(drakeIKoptions drakeRBM)

if (MATLAB_FOUND)
  macro(add_ikoptions_mex)
    add_mex(${ARGV} ${ARGV}.cpp)
    target_link_libraries(${ARGV} drakeRBM drakeMexUtil drakeIKoptions)
  endmacro()
  add_ikoptions_mex(IKoptionsmex)

  macro(add_constraint_mex)
    add_mex(${ARGV} ${ARGV}.cpp)
    target_link_libraries(${ARGV} drakeRBM drakeUtil drakeRigidBodyConstraint)
  endmacro()
endif(MATLAB_FOUND)

set(drakeIK_SRC_FILES IKoptions.cpp)
set(drakeIK_PODS_PKG )
if(gurobi_FOUND)
  set(drakeIK_SRC_FILES ${drakeIK_SRC_FILES} approximateIK.cpp)
  set(drakeIK_PODS_PKG ${drakeIK_PODS_PKG} gurobi)
endif()
if(snopt_c_FOUND)
  set(drakeIK_SRC_FILES ${drakeIK_SRC_FILES} inverseKin.cpp inverseKinPointwise.cpp inverseKinTraj.cpp inverseKinBackend.cpp)
  set(drakeIK_PODS_PKG ${drakeIK_PODS_PKG} snopt_c)
endif()
add_library(drakeIK SHARED ${drakeIK_SRC_FILES})
pods_use_pkg_config_packages(drakeIK ${drakeIK_PODS_PKG})
target_link_libraries(drakeIK drakeRBM drakeRigidBodyConstraint drakeIKoptions)
set_target_properties(drakeIK PROPERTIES COMPILE_FLAGS -fPIC)
pods_install_libraries(drakeIK)
pods_install_libraries(drakeIKoptions)
pods_install_headers(RigidBodyIK.h IKoptions.h DESTINATION drake)
pods_install_pkg_config_file(drake-ik
  LIBS -ldrakeIK -ldrakeRigidBodyConstraint -ldrakeIKoptions
  REQUIRES drake-rbm
  VERSION 0.0.1)

if (MATLAB_FOUND)
  if (gurobi_FOUND)
    add_mex(approximateIKmex approximateIKmex.cpp)
    target_link_libraries(approximateIKmex drakeIK drakeRBM drakeMexUtil drakeRigidBodyConstraint)
    pods_use_pkg_config_packages(approximateIKmex gurobi)
  endif()

  macro(add_IK_mex)
    add_mex(${ARGV} ${ARGV}.cpp)
    target_link_libraries(${ARGV} drakeIK drakeRBM drakeMexUtil drakeRigidBodyConstraint)
#    pods_use_pkg_config_packages(${ARGV} snopt_c)
  endmacro()

  if (snopt_c_FOUND)
    add_IK_mex(inverseKinmex)
    add_IK_mex(inverseKinPointwisemex)
    add_IK_mex(inverseKinTrajmex)
  endif()
endif(MATLAB_FOUND)

add_subdirectory(test)
<commit_msg>add mex to cmakeList<commit_after>include_directories (${PROJECT_SOURCE_DIR}/util tinyxml)
# IMPORTANT NOTE!!
# matlab has it's own boost libraries.  DO NOT let any mex file depend
# on the system boost (directly nor indirectly), or you're asking for trouble.

include_directories(joints)
include_directories(${PROJECT_SOURCE_DIR}/solvers)

add_library(drakeRBM SHARED RigidBodyManipulator.cpp RigidBody.cpp RigidBodyManipulatorURDF.cpp RigidBodyManipulatorContact.cpp tinyxml/tinyxml.cpp tinyxml/tinyxmlparser.cpp tinyxml/tinyxmlerror.cpp)
target_link_libraries(drakeRBM drakeCollision drakeJoints spruce drakeUtil)
pods_install_libraries(drakeRBM)
pods_install_headers(RigidBodyManipulator.h RigidBody.h RigidBodyFrame.h KinematicPath.h KinematicsCache.h ForceTorqueMeasurement.h DESTINATION drake)
pods_install_pkg_config_file(drake-rbm
  LIBS -ldrakeRBM -ldrakeCollision -ldrakeJoints -lspruce -ldrakeUtil
  REQUIRES
  VERSION 0.0.1)

pods_find_pkg_config(gurobi)
pods_find_pkg_config(snopt_c)
add_subdirectory(shapes)
add_subdirectory(collision)
add_subdirectory(constraint)
add_subdirectory(joints)

add_subdirectory(viewer)

if (MATLAB_FOUND)
  macro(add_rbm_mex)
    # todo: use this again once I can assume everyone has CMAKE version >= 2.8.8
#    add_mex(${ARGV} ${ARGV}.cpp $<TARGET_OBJECTS:drakeUtil>)
#    target_link_libraries(${ARGV} drakeRBM)
    add_mex(${ARGV} ${ARGV}.cpp)
    target_link_libraries(${ARGV} drakeRBM drakeMexUtil)
  endmacro()

  add_rbm_mex(constructModelmex)
  add_rbm_mex(collisionDetectmex)
  add_rbm_mex(smoothDistancePenaltymex)
  add_rbm_mex(collisionRaycastmex)
  add_rbm_mex(allCollisionsmex)
  add_rbm_mex(collidingPointsmex)
  add_rbm_mex(findKinematicPathmex)
  target_link_libraries(findKinematicPathmex drakeUtil)
  add_rbm_mex(geometricJacobianmex)
  target_link_libraries(geometricJacobianmex drakeUtil)
  add_rbm_mex(doKinematicsmex)
  add_rbm_mex(forwardKinmex)
  add_rbm_mex(forwardKinPositionGradientmex)
  add_rbm_mex(centerOfMassmex)
  add_rbm_mex(centroidalMomentumMatrixmex)
  add_rbm_mex(massMatrixmex)
  add_rbm_mex(inverseDynamicsmex)
  add_rbm_mex(geometricJacobianDotTimesVmex)
  add_rbm_mex(centroidalMomentumMatrixDotTimesVmex)
  add_rbm_mex(centerOfMassJacobianDotTimesVmex)
  add_rbm_mex(forwardJacDotTimesVmex)
  add_rbm_mex(contactConstraintsmex)
  add_rbm_mex(surfaceTangentsmex)
  add_rbm_mex(jointLimitConstraintsmex)
  add_rbm_mex(positionConstraintsmex)
  add_rbm_mex(testFrameParsermex)
  add_rbm_mex(computeS1Trajmex)
  add_rbm_mex(createKinematicsCachemex)
  target_link_libraries(computeS1Trajmex drakeZMPUtil)

  if(gurobi_FOUND)
    add_definitions(-DPATHLCP_MEXFILE=\"${PROJECT_SOURCE_DIR}/thirdParty/path/lcppath.${MEX_EXT}\")
    add_mex(solveLCPmex solveLCPmex.cpp)
    target_link_libraries(solveLCPmex drakeRBM drakeMexUtil drakeQP)
  endif()
endif(MATLAB_FOUND)

include_directories( constraint )
add_library(drakeIKoptions SHARED IKoptions.cpp)
target_link_libraries(drakeIKoptions drakeRBM)

if (MATLAB_FOUND)
  macro(add_ikoptions_mex)
    add_mex(${ARGV} ${ARGV}.cpp)
    target_link_libraries(${ARGV} drakeRBM drakeMexUtil drakeIKoptions)
  endmacro()
  add_ikoptions_mex(IKoptionsmex)

  macro(add_constraint_mex)
    add_mex(${ARGV} ${ARGV}.cpp)
    target_link_libraries(${ARGV} drakeRBM drakeUtil drakeRigidBodyConstraint)
  endmacro()
endif(MATLAB_FOUND)

set(drakeIK_SRC_FILES IKoptions.cpp)
set(drakeIK_PODS_PKG )
if(gurobi_FOUND)
  set(drakeIK_SRC_FILES ${drakeIK_SRC_FILES} approximateIK.cpp)
  set(drakeIK_PODS_PKG ${drakeIK_PODS_PKG} gurobi)
endif()
if(snopt_c_FOUND)
  set(drakeIK_SRC_FILES ${drakeIK_SRC_FILES} inverseKin.cpp inverseKinPointwise.cpp inverseKinTraj.cpp inverseKinBackend.cpp)
  set(drakeIK_PODS_PKG ${drakeIK_PODS_PKG} snopt_c)
endif()
add_library(drakeIK SHARED ${drakeIK_SRC_FILES})
pods_use_pkg_config_packages(drakeIK ${drakeIK_PODS_PKG})
target_link_libraries(drakeIK drakeRBM drakeRigidBodyConstraint drakeIKoptions)
set_target_properties(drakeIK PROPERTIES COMPILE_FLAGS -fPIC)
pods_install_libraries(drakeIK)
pods_install_libraries(drakeIKoptions)
pods_install_headers(RigidBodyIK.h IKoptions.h DESTINATION drake)
pods_install_pkg_config_file(drake-ik
  LIBS -ldrakeIK -ldrakeRigidBodyConstraint -ldrakeIKoptions
  REQUIRES drake-rbm
  VERSION 0.0.1)

if (MATLAB_FOUND)
  if (gurobi_FOUND)
    add_mex(approximateIKmex approximateIKmex.cpp)
    target_link_libraries(approximateIKmex drakeIK drakeRBM drakeMexUtil drakeRigidBodyConstraint)
    pods_use_pkg_config_packages(approximateIKmex gurobi)
  endif()

  macro(add_IK_mex)
    add_mex(${ARGV} ${ARGV}.cpp)
    target_link_libraries(${ARGV} drakeIK drakeRBM drakeMexUtil drakeRigidBodyConstraint)
#    pods_use_pkg_config_packages(${ARGV} snopt_c)
  endmacro()

  if (snopt_c_FOUND)
    add_IK_mex(inverseKinmex)
    add_IK_mex(inverseKinPointwisemex)
    add_IK_mex(inverseKinTrajmex)
  endif()
endif(MATLAB_FOUND)

add_subdirectory(test)

{'fraction_non_alphanumeric': 0.07727597104699765, 'fraction_numerical': 0.00224283820980732, 'mean_word_length': 8.298578199052132, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, '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': '5090005', 'n_tokens_mistral': 4237, 'n_tokens_neox': 4002, 'n_words': 504}