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

ADD_DEFINITIONS(-DDEBUG=2)

Francois Bleibel's avatar
Francois Bleibel committed
18
SET(tests
19
test_constructor
20
#test_config
21
22
23
24
25
#  dummy
#  test_djj
#  test_dyn
#  test_results
)
Francois Bleibel's avatar
Francois Bleibel committed
26

27
28
29
30
31

#----------------------------------------------------
# Install procedure for the urdf files
#----------------------------------------------------

32
33
SET(test_dyn_plugins_dependencies dynamic)

34
35
36
37
# Make Boost.Test generates the main function in test cases.
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)


38
# getting the information for the robot.
39
40
41
42
43
44
45
46
47
#SET(samplemodelpath ${JRL_DYNAMICS_PKGDATAROOTDIR}/jrl-dynamics/examples/data/)
#SET(samplespec
#  ${JRL_DYNAMICS_PKGDATAROOTDIR}/jrl-dynamics/examples/data/sampleSpecificities.xml
#  )
#SET(sampleljr
#  ${JRL_DYNAMICS_PKGDATAROOTDIR}/jrl-dynamics/examples/data/sampleLinkJointRank.xml
#  )
#SET(sampleinitconfig
#  ${JRL_DYNAMICS_PKGDATAROOTDIR}/jrl-dynamics/examples/data/sampleInitConfig.dat)
48
49
50

LIST(APPEND LOGGING_WATCHED_VARIABLES samplespec sampleljr)

Francois Bleibel's avatar
Francois Bleibel committed
51
FOREACH(test ${tests})
52
53
54
  SET(EXECUTABLE_NAME "${test}_exe")
  ADD_EXECUTABLE(${EXECUTABLE_NAME}
    ${test}.cpp)
Olivier Stasse's avatar
Olivier Stasse committed
55
56
  MESSAGE("PYTHON_INCLUDE_PATH: ${PYTHON_INCLUDE_PATH}")
  INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
57

58
  TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME}
59
60
    dp-zmpreffromcom
    dp-force-compensation
61
    #integrator-force-exact
62
63
64
65
66
    dp-mass-apparent
    dp-integrator-force-rk4
    dp-integrator-force
    dp-angle-estimator
    dp-waist-attitude-from-sensor
67
    ${LIBRARY_NAME}
68
69
    )

70
  PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} pinocchio)
71
72
  PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} sot-core)
  PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} dynamic-graph)
Olivier Stasse's avatar
Olivier Stasse committed
73
  PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} dynamic-graph-python)
74

75
76
77
78
79
  IF(${test}_plugins_dependencies)
    ADD_DEPENDENCIES(${EXECUTABLE_NAME} "${${test}_plugins_dependencies}")
    TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} "${${test}_plugins_dependencies}")
  ENDIF(${test}_plugins_dependencies)

80
  TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} ${Boost_LIBRARIES} ${Boost_SYSTEM_LIBRARY})
81
  ADD_TEST(${test} ${EXECUTABLE_NAME}
82
    ${samplemodelpath} ${samplespec} ${sampleljr} )
83
84

  IF (UNIX)
Florent Lamiraux's avatar
Florent Lamiraux committed
85
    SET(EXTRA_LD_LIBRARY_PATH $ENV{LD_LIBRARY_PATH})
86
    SET_PROPERTY(TEST ${test} PROPERTY
87
      ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}:${CMAKE_BINARY_DIR}/src:${BOOST_ROOT}/lib:${EXTRA_LD_LIBRARY_PATH}")
88
89
  ENDIF(UNIX)

Thomas Moulard's avatar
Thomas Moulard committed
90
ENDFOREACH(test)