CMakeLists.txt 1.92 KB
Newer Older
Justin Carpentier's avatar
Justin Carpentier committed
1
#
2
# Copyright (c) 2015-2020 CNRS INRIA
Justin Carpentier's avatar
Justin Carpentier committed
3
4
#

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FUNCTION(ADD_PINOCCHIO_CPP_EXAMPLE EXAMPLE)
  GET_FILENAME_COMPONENT(EXAMPLE_NAME ${EXAMPLE} NAME)
  SET(EXAMPLE_NAME "example-cpp-${EXAMPLE_NAME}")
  ADD_UNIT_TEST(${EXAMPLE_NAME} ${EXAMPLE})
  TARGET_LINK_LIBRARIES(${EXAMPLE_NAME} ${PROJECT_NAME})
  PKG_CONFIG_USE_DEPENDENCY(${EXAMPLE_NAME} eigen3)
  IF(URDFDOM_FOUND)
    PKG_CONFIG_USE_DEPENDENCY(${EXAMPLE_NAME} urdfdom)
  ENDIF(URDFDOM_FOUND)
  IF(HPP_FCL_FOUND)
    PKG_CONFIG_USE_DEPENDENCY(${EXAMPLE_NAME} hpp-fcl)
  ENDIF(HPP_FCL_FOUND)
  IF(CPPAD_FOUND)
    PKG_CONFIG_USE_DEPENDENCY(${EXAMPLE_NAME} "cppad")
  ENDIF(CPPAD_FOUND)
ENDFUNCTION()

22
SET(${PROJECT_NAME}_EXAMPLES
23
  inverse-kinematics
24
  overview-simple
25
  overview-lie
26
  overview-SE3
27
  overview-urdf
28
  interpolation-SE3
29
  build-reduced-model
30
  geometry-models
31
  kinematics-derivatives
32
  forward-dynamics-derivatives
33
  inverse-dynamics-derivatives
34
  multiprecision
35
36
  )

37
38
39
40
41
42
IF(HPP_FCL_FOUND)
  LIST(APPEND ${PROJECT_NAME}_EXAMPLES
    collisions
    )
ENDIF(HPP_FCL_FOUND)

43
44
ADD_DEFINITIONS(-DPINOCCHIO_MODEL_DIR="${PINOCCHIO_MODEL_DIR}")

45
FOREACH(EXAMPLE ${${PROJECT_NAME}_EXAMPLES})
46
  ADD_PINOCCHIO_CPP_EXAMPLE(${EXAMPLE})
47
ENDFOREACH(EXAMPLE ${${PROJECT_NAME}_EXAMPLES})
48

49
50
IF(BUILD_PYTHON_INTERFACE)
  SET(${PROJECT_NAME}_PYTHON_EXAMPLES
51
    inverse-kinematics
52
    overview-simple
53
    overview-urdf
54
    kinematics-derivatives
55
56
    forward-dynamics-derivatives
    inverse-dynamics-derivatives
57
58
    gepetto-viewer
    meshcat-viewer
Gabriele Buondonno's avatar
Gabriele Buondonno committed
59
    meshcat-viewer-dae
60
    robot-wrapper-viewer
61
    geometry-models
62
63
    )

64
65
66
  IF(HPP_FCL_FOUND)
    LIST(APPEND ${PROJECT_NAME}_PYTHON_EXAMPLES 
      collisions
67
      sample-model-viewer
68
      display-shapes
69
70
71
      )
  ENDIF(HPP_FCL_FOUND)

72
  FOREACH(EXAMPLE ${${PROJECT_NAME}_PYTHON_EXAMPLES})
73
    ADD_PYTHON_UNIT_TEST("example-py-${EXAMPLE}" "examples/${EXAMPLE}.py" "bindings/python")
74
75
  ENDFOREACH(EXAMPLE ${${PROJECT_NAME}_PYTHON_EXAMPLES})
ENDIF(BUILD_PYTHON_INTERFACE)