CMakeLists.txt 3.42 KB
Newer Older
1
2
# Copyright 2010, François Bleibel, Olivier Stasse, JRL, CNRS/AIST,
#                 Florent Lamiraux (CNRS/LAAS)
Thomas Moulard's avatar
Thomas Moulard committed
3
#
4
5
# This file is part of sot-dynamic-pinocchio.
# sot-dynamic-pinocchio is free software: you can redistribute it and/or
Thomas Moulard's avatar
Thomas Moulard committed
6
7
8
9
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
10
# sot-dynamic-pinocchio is distributed in the hope that it will be useful, but
Thomas Moulard's avatar
Thomas Moulard committed
11
12
13
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Lesser Public License for more details.  You should have
# received a copy of the GNU Lesser General Public License along with
15
# sot-dynamic-pinocchio. If not, see <http://www.gnu.org/licenses/>.
Francois Bleibel's avatar
Francois Bleibel committed
16

17
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
18

19
20
21
22
23
# Verbosity level
IF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
  ADD_DEFINITIONS(-DVP_DEBUG_MODE=${CMAKE_VERBOSITY_LEVEL} -DVP_DEBUG)
ENDIF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))

Francois Bleibel's avatar
Francois Bleibel committed
24
IF(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
Thomas Moulard's avatar
Thomas Moulard committed
25
  ADD_DEFINITIONS(-DDEBUG=2)
Francois Bleibel's avatar
Francois Bleibel committed
26
27
28
29
30
ENDIF(CMAKE_BUILD_TYPE STREQUAL "DEBUG")

SET(integrator-force-rk4_plugins_dependencies integrator-force)
SET(integrator-force-exact_plugins_dependencies integrator-force)

31
FOREACH(lib ${plugins})
32
33
34
  SET(libname dp-${lib})
  ADD_LIBRARY(${libname} SHARED ${lib}.cpp)
  SET_TARGET_PROPERTIES(${libname} PROPERTIES
Thomas Moulard's avatar
Thomas Moulard committed
35
    PREFIX ""
Thomas Moulard's avatar
Thomas Moulard committed
36
    SOVERSION ${PROJECT_VERSION})
Thomas Moulard's avatar
Thomas Moulard committed
37
38

  IF(${lib}_plugins_dependencies)
39
40
    ADD_DEPENDENCIES(${libname} "dp-${${lib}_plugins_dependencies}")
    TARGET_LINK_LIBRARIES(${libname} "dp-${${lib}_plugins_dependencies}")
Thomas Moulard's avatar
Thomas Moulard committed
41
42
  ENDIF(${lib}_plugins_dependencies)

43
  TARGET_LINK_LIBRARIES(${libname} ${Boost_LIBRARIES})
44

45
46
47
48
  PKG_CONFIG_USE_DEPENDENCY(${libname} pinocchio)
  PKG_CONFIG_USE_DEPENDENCY(${libname} eigenpy)
  PKG_CONFIG_USE_DEPENDENCY(${libname} sot-core)
  PKG_CONFIG_USE_DEPENDENCY(${libname} dynamic-graph)
49

50
  INSTALL(TARGETS ${libname} DESTINATION ${DYNAMIC_GRAPH_PLUGINDIR})
51

52
  # build python submodule
53
54
  IF(BUILD_PYTHON_INTERFACE)
    STRING(REPLACE - _ PYTHON_LIBRARY_NAME ${lib})
55

56
57
58
59
60
    DYNAMIC_GRAPH_PYTHON_MODULE("sot/dynamics_pinocchio/${PYTHON_LIBRARY_NAME}"
      ${libname}
      sot-dynamic-pinocchio-${PYTHON_LIBRARY_NAME}-wrap
      )
  ENDIF(BUILD_PYTHON_INTERFACE)
61
  UNSET({libname})
Francois Bleibel's avatar
Francois Bleibel committed
62
ENDFOREACH(lib)
Thomas Moulard's avatar
Thomas Moulard committed
63

64
# Main Library
65
ADD_LIBRARY(${LIBRARY_NAME} SHARED sot-dynamic-pinocchio.cpp)
66
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} pinocchio)
67
68
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} sot-core)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} dynamic-graph)
69
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} pinocchio)
70
71
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} sot-core)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} dynamic-graph)
72
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
73
INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
74

75
TARGET_LINK_LIBRARIES(dp-dynamic ${LIBRARY_NAME})
76

77
# Install empty __init__.py files in intermediate directories.
78
79
80
81
82
83
84
85
86
IF(BUILD_PYTHON_INTERFACE)
  INSTALL(FILES
    ${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics_pinocchio/__init__.py
    ${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics_pinocchio/humanoid_robot.py
    ${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics_pinocchio/tools.py
    ${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics_pinocchio/parser.py
    DESTINATION ${PYTHON_SITELIB}/dynamic_graph/sot/dynamics_pinocchio
    )
ENDIF(BUILD_PYTHON_INTERFACE)