-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
107 lines (87 loc) · 4.03 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Copyright 2010, Thomas Moulard, LAAS-CNRS
#
# This file is part of roboptim-core. roboptim-core 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.
#
# roboptim-core 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 roboptim-core. If not, see <http://www.gnu.org/licenses/>.
# Requires at least CMake 2.6 to configure the package.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/ros.cmake)
SET(PROJECT_NAME roboptim-retargeting)
SET(PROJECT_DESCRIPTION "RobOptim retargeting")
SET(PROJECT_URL "http://github.com/thomas-moulard/roboptim-retargeting")
SET(PKG_CONFIG_ADDITIONAL_VARIABLES plugindir ${PKG_CONFIG_ADDITIONAL_VARIABLES})
SET(CSD ${CMAKE_SOURCE_DIR})
SET(HEADERS
${CSD}/include/roboptim/retargeting/function/body-laplacian-deformation-energy/choreonoid.hh
${CSD}/include/roboptim/retargeting/function/torque.hh
${CSD}/include/roboptim/retargeting/function/zmp/inverted-pendulum.hh
${CSD}/include/roboptim/retargeting/function/zmp/choreonoid.hh
${CSD}/include/roboptim/retargeting/function/zmp/metapod.hh
${CSD}/include/roboptim/retargeting/function/minimum-jerk-trajectory.hxx
${CSD}/include/roboptim/retargeting/function/torque/choreonoid.hh
${CSD}/include/roboptim/retargeting/function/torque/metapod.hh
${CSD}/include/roboptim/retargeting/function/forward-geometry/choreonoid.hh
${CSD}/include/roboptim/retargeting/function/zmp.hh
${CSD}/include/roboptim/retargeting/function/joint-to-marker/choreonoid.hh
${CSD}/include/roboptim/retargeting/function/laplacian-coordinate/choreonoid.hh
${CSD}/include/roboptim/retargeting/function/acceleration.hh
${CSD}/include/roboptim/retargeting/function/choreonoid-body-trajectory.hh
${CSD}/include/roboptim/retargeting/function/forward-geometry.hh
${CSD}/include/roboptim/retargeting/function/cost-reference-trajectory.hh
${CSD}/include/roboptim/retargeting/function/marker-laplacian-deformation-energy/choreonoid.hh
${CSD}/include/roboptim/retargeting/function/minimum-jerk-trajectory.hh
${CSD}/include/roboptim/retargeting/eigen-rigid-body.hh
${CSD}/include/roboptim/retargeting/eigen-rigid-body.hxx
)
SETUP_PROJECT()
# Check compiler flags and enable them if possible
INCLUDE(CheckCCompilerFlag)
CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAS_VISIBILITY)
IF(HAS_VISIBILITY)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
ENDIF()
# FIXME: Disable this on Travis for now.
IF(NOT $ENV{TRAVIS} STREQUAL true)
CHECK_C_COMPILER_FLAG(-Wl,--no-undefined HAS_NO_UNDEFINED)
IF(HAS_NO_UNDEFINED)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined")
ENDIF()
CHECK_C_COMPILER_FLAG(-Wl,--as-needed HAS_AS_NEEDED)
IF(HAS_AS_NEEDED)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--as-needed")
ENDIF()
ENDIF()
# Add main library to pkg-config file.
PKG_CONFIG_APPEND_LIBS(roboptim-retargeting)
# Search for dependencies.
SET(BOOST_COMPONENTS date_time filesystem system
thread program_options unit_test_framework)
SEARCH_FOR_BOOST()
ADD_REQUIRED_DEPENDENCY("libmocap")
ADD_REQUIRED_DEPENDENCY("roboptim-core >= 0.5")
ADD_REQUIRED_DEPENDENCY("roboptim-core-plugin-ipopt >= 0.5")
ADD_REQUIRED_DEPENDENCY("roboptim-trajectory >= 0.5")
ADD_REQUIRED_DEPENDENCY("choreonoid")
ADD_REQUIRED_DEPENDENCY("choreonoid-body-plugin")
ADD_REQUIRED_DEPENDENCY("yaml-cpp")
HEADER_INSTALL("${HEADERS}")
# Allow the inclusion of private headers.
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/src")
# Order matters here: the library (in src) _must_ be compiled before
# the cli tools and the tests.
ADD_SUBDIRECTORY(share)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(bin)
ADD_SUBDIRECTORY(tests)
SETUP_PROJECT_FINALIZE()