CMakeLists.txt 1.88 KB
Newer Older
1
# Copyright 2014, 2020, Andrea Del Prete, Guilhem Saurel, LAAS-CNRS
andreadelprete's avatar
andreadelprete committed
2
3
4
#

SET(plugins
Guilhem Saurel's avatar
Guilhem Saurel committed
5
  admittance-controller
6
  base-estimator
Olivier Stasse's avatar
Olivier Stasse committed
7
8
  control-manager
  current-controller
Guilhem Saurel's avatar
Guilhem Saurel committed
9
  device-torque-ctrl
Olivier Stasse's avatar
Olivier Stasse committed
10
  free-flyer-locator
Guilhem Saurel's avatar
Guilhem Saurel committed
11
  imu_offset_compensation
Olivier Stasse's avatar
Olivier Stasse committed
12
  inverse-dynamics-balance-controller
13
  simple-inverse-dyn
Olivier Stasse's avatar
Olivier Stasse committed
14
  joint-torque-controller
andreadelprete's avatar
andreadelprete committed
15
  joint-trajectory-generator
Guilhem Saurel's avatar
Guilhem Saurel committed
16
17
  numerical-difference
  position-controller
18
  se3-trajectory-generator
19
  torque-offset-estimator
20
  trace-player
andreadelprete's avatar
andreadelprete committed
21
22
  )

23
IF(DDP_ACTUATOR_SOLVER_FOUND)
24
25
  SET(plugins ${plugins} ddp-actuator-solver)
  SET(plugins ${plugins} ddp_pyrene_actuator_solver)
26
ENDIF(DDP_ACTUATOR_SOLVER_FOUND)
andreadelprete's avatar
andreadelprete committed
27
28
29

FOREACH(plugin ${plugins})
  GET_FILENAME_COMPONENT(LIBRARY_NAME ${plugin} NAME)
Guilhem Saurel's avatar
Guilhem Saurel committed
30
  ADD_LIBRARY(${LIBRARY_NAME} SHARED "${plugin}.cpp")
31

32
33
34
  IF(SUFFIX_SO_VERSION)
    SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
  ENDIF(SUFFIX_SO_VERSION)
andreadelprete's avatar
andreadelprete committed
35

36
  TARGET_LINK_LIBRARIES(${LIBRARY_NAME} PUBLIC ${PROJECT_NAME} ${${LIBRARY_NAME}_deps})
andreadelprete's avatar
andreadelprete committed
37

38
39
40
41
  IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
    INSTALL(TARGETS ${LIBRARY_NAME} EXPORT ${TARGETS_EXPORT_NAME}
      DESTINATION ${DYNAMIC_GRAPH_PLUGINDIR})
  ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
42

43
44
  IF(BUILD_PYTHON_INTERFACE)
    STRING(REPLACE - _ PYTHON_LIBRARY_NAME ${LIBRARY_NAME})
45
46
47
48
49
50
51
52
53
    if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${plugin}-python-module-py.cc")
      DYNAMIC_GRAPH_PYTHON_MODULE("${PYTHON_DIR}/${PYTHON_LIBRARY_NAME}"
        ${LIBRARY_NAME} ${PROJECT_NAME}-${PYTHON_LIBRARY_NAME}-wrap
        SOURCE_PYTHON_MODULE "${CMAKE_CURRENT_SOURCE_DIR}/${plugin}-python-module-py.cc")
    elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${plugin}-python.hh")
      DYNAMIC_GRAPH_PYTHON_MODULE("${PYTHON_DIR}/${PYTHON_LIBRARY_NAME}"
        ${LIBRARY_NAME} ${PROJECT_NAME}-${PYTHON_LIBRARY_NAME}-wrap
        MODULE_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/${plugin}-python.hh")
    endif()
54
  ENDIF(BUILD_PYTHON_INTERFACE)
andreadelprete's avatar
andreadelprete committed
55
ENDFOREACH(plugin)