CMakeLists.txt 1.98 KB
Newer Older
Thomas Moulard's avatar
Thomas Moulard committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Copyright 2010, François Bleibel, Olivier Stasse, JRL, CNRS/AIST
#
# This file is part of sot-dynamic.
# sot-dynamic is free software: you can redistribute it and/or
# 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.
#
# sot-dynamic is distributed in the hope that it will be useful, but
# 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
# sot-dynamic. If not, see <http://www.gnu.org/licenses/>.
Francois Bleibel's avatar
Francois Bleibel committed
15
16

IF(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
Thomas Moulard's avatar
Thomas Moulard committed
17
  ADD_DEFINITIONS(-DDEBUG=2)
Francois Bleibel's avatar
Francois Bleibel committed
18
19
20
21
22
ENDIF(CMAKE_BUILD_TYPE STREQUAL "DEBUG")

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

Thomas Moulard's avatar
Thomas Moulard committed
23
24
25
26
SET(dynamic-hrp2_plugins_dependencies dynamic)
SET(dynamic-hrp2_10_plugins_dependencies dynamic)
SET(dynamic-hrp2_10_old_plugins_dependencies dynamic)

Francois Bleibel's avatar
Francois Bleibel committed
27
FOREACH(lib ${libs})
Thomas Moulard's avatar
Thomas Moulard committed
28
  ADD_LIBRARY(${lib} SHARED ${lib}.cpp)
Thomas Moulard's avatar
Thomas Moulard committed
29

Thomas Moulard's avatar
Thomas Moulard committed
30
  SET_TARGET_PROPERTIES(${lib} PROPERTIES
Thomas Moulard's avatar
Thomas Moulard committed
31
    PREFIX ""
Thomas Moulard's avatar
Thomas Moulard committed
32
    SOVERSION ${PROJECT_VERSION})
Thomas Moulard's avatar
Thomas Moulard committed
33
34
35
36
37
38

  IF(${lib}_plugins_dependencies)
    ADD_DEPENDENCIES(${lib} "${${lib}_plugins_dependencies}")
    TARGET_LINK_LIBRARIES(${lib} "${${lib}_plugins_dependencies}")
  ENDIF(${lib}_plugins_dependencies)

39
  PKG_CONFIG_USE_DEPENDENCY(${lib} jrl-dynamics)
40
41
42
43
  PKG_CONFIG_USE_DEPENDENCY(${lib} hrp2-dynamics)
  PKG_CONFIG_USE_DEPENDENCY(${lib} sot-core)
  PKG_CONFIG_USE_DEPENDENCY(${lib} dynamic-graph)
  PKG_CONFIG_USE_DEPENDENCY(${lib} jrl-mal)
44

Thomas Moulard's avatar
Thomas Moulard committed
45
  INSTALL(TARGETS ${lib} DESTINATION lib/plugin)
Francois Bleibel's avatar
Francois Bleibel committed
46
ENDFOREACH(lib)
Thomas Moulard's avatar
Thomas Moulard committed
47
48
49
50
51
52
53

PKG_CONFIG_USE_DEPENDENCY(dynamic-hrp2 hrp2-dynamics)

IF(${HRP2_10_OPTIMIZED_FOUND})
  PKG_CONFIG_USE_DEPENDENCY(dynamic-hrp2_10 hrp2-10-optimized)
  PKG_CONFIG_USE_DEPENDENCY(dynamic-hrp2_10_old hrp2-10-optimized)
ENDIF()