CMakeLists.txt 2.07 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
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})
9
  TARGET_LINK_LIBRARIES(${EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
10
11
12
13
14
15
16
17
18
19
20
21
  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(BUILD_ADVANCED_TESTING)
  LIST(APPEND ${PROJECT_NAME}_EXAMPLES
    multiprecision
    )
ENDIF(BUILD_ADVANCED_TESTING)

43
44
45
46
47
48
IF(HPP_FCL_FOUND)
  LIST(APPEND ${PROJECT_NAME}_EXAMPLES
    collisions
    )
ENDIF(HPP_FCL_FOUND)

49
50
ADD_DEFINITIONS(-DPINOCCHIO_MODEL_DIR="${PINOCCHIO_MODEL_DIR}")

51
FOREACH(EXAMPLE ${${PROJECT_NAME}_EXAMPLES})
52
  ADD_PINOCCHIO_CPP_EXAMPLE(${EXAMPLE})
53
ENDFOREACH(EXAMPLE ${${PROJECT_NAME}_EXAMPLES})
54

55
56
IF(BUILD_PYTHON_INTERFACE)
  SET(${PROJECT_NAME}_PYTHON_EXAMPLES
57
    inverse-kinematics
58
    overview-simple
59
    overview-urdf
60
    kinematics-derivatives
61
62
    forward-dynamics-derivatives
    inverse-dynamics-derivatives
63
64
    gepetto-viewer
    meshcat-viewer
Gabriele Buondonno's avatar
Gabriele Buondonno committed
65
    meshcat-viewer-dae
66
    robot-wrapper-viewer
67
    geometry-models
68
69
    )

70
71
72
  IF(HPP_FCL_FOUND)
    LIST(APPEND ${PROJECT_NAME}_PYTHON_EXAMPLES 
      collisions
73
      sample-model-viewer
74
      display-shapes
75
76
77
      )
  ENDIF(HPP_FCL_FOUND)

78
  FOREACH(EXAMPLE ${${PROJECT_NAME}_PYTHON_EXAMPLES})
79
    ADD_PYTHON_UNIT_TEST("example-py-${EXAMPLE}" "examples/${EXAMPLE}.py" "bindings/python")
80
81
  ENDFOREACH(EXAMPLE ${${PROJECT_NAME}_PYTHON_EXAMPLES})
ENDIF(BUILD_PYTHON_INTERFACE)
82
83

ADD_SUBDIRECTORY(codegen)