CMakeLists.txt 1.71 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
SET(${PROJECT_NAME}_EXAMPLES
6
  inverse-kinematics
7
  overview-simple
8
  overview-lie
9
  overview-SE3
10
  overview-urdf
11
  interpolation-SE3
12
  build-reduced-model
13
  geometry-models
14
  kinematics-derivatives
15
  inverse-dynamics-derivatives
16
17
  )

18
19
20
21
22
23
IF(HPP_FCL_FOUND)
  LIST(APPEND ${PROJECT_NAME}_EXAMPLES
    collisions
    )
ENDIF(HPP_FCL_FOUND)

24
25
ADD_DEFINITIONS(-DPINOCCHIO_MODEL_DIR="${PINOCCHIO_MODEL_DIR}")

26
FOREACH(EXAMPLE ${${PROJECT_NAME}_EXAMPLES})
27
28
  SET(EXAMPLE_NAME "example-${EXAMPLE}")
  ADD_UNIT_TEST(${EXAMPLE_NAME} ${EXAMPLE})
29
  TARGET_LINK_LIBRARIES(${EXAMPLE_NAME} ${PROJECT_NAME})
30
  PKG_CONFIG_USE_DEPENDENCY(${EXAMPLE_NAME} eigen3)
31
32
33
  IF(URDFDOM_FOUND)
    PKG_CONFIG_USE_DEPENDENCY(${EXAMPLE_NAME} urdfdom)
  ENDIF(URDFDOM_FOUND)
34
  IF(HPP_FCL_FOUND)
35
    PKG_CONFIG_USE_DEPENDENCY(${EXAMPLE_NAME} hpp-fcl)
36
  ENDIF(HPP_FCL_FOUND)
37
38
39
  IF(CPPAD_FOUND)
    PKG_CONFIG_USE_DEPENDENCY(${EXAMPLE_NAME} "cppad")
  ENDIF(CPPAD_FOUND)
40
ENDFOREACH(EXAMPLE ${${PROJECT_NAME}_EXAMPLES})
41

42
43
IF(BUILD_PYTHON_INTERFACE)
  SET(${PROJECT_NAME}_PYTHON_EXAMPLES
44
    inverse-kinematics
45
    overview-simple
46
    overview-urdf
47
    kinematics-derivatives
48
49
    forward-dynamics-derivatives
    inverse-dynamics-derivatives
50
51
    gepetto-viewer
    meshcat-viewer
Gabriele Buondonno's avatar
Gabriele Buondonno committed
52
    meshcat-viewer-dae
53
    robot-wrapper-viewer
54
    geometry-models
55
56
    )

57
58
59
  IF(HPP_FCL_FOUND)
    LIST(APPEND ${PROJECT_NAME}_PYTHON_EXAMPLES 
      collisions
60
      sample-model-viewer
61
      display-shapes
62
63
64
      )
  ENDIF(HPP_FCL_FOUND)

65
  FOREACH(EXAMPLE ${${PROJECT_NAME}_PYTHON_EXAMPLES})
66
    ADD_PYTHON_UNIT_TEST("example-py-${EXAMPLE}" "examples/${EXAMPLE}.py" "bindings/python")
67
68
  ENDFOREACH(EXAMPLE ${${PROJECT_NAME}_PYTHON_EXAMPLES})
ENDIF(BUILD_PYTHON_INTERFACE)