-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
executable file
·158 lines (131 loc) · 4.47 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
SET(PROJECT_NAME HQP)
SET(PROJECT_DESCRIPTION "HQP algorithm for franka-husky mobile manipulator")
SET(PROJECT_URL "http://github.com/jkw0701")
OPTION(INSTALL_DOCUMENTATION "Generate and install the documentation" OFF)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
LIST( APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../rbdl" )
LIST( APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}" )
MESSAGE( STATUS "CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH} )
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
#INCLUDE(cmake/eigen.cmake)
INCLUDE(cmake/FindRBDL.cmake)
INCLUDE(cmake/ide.cmake)
link_directories(${Boost_LIBRARY_DIR})
IF(APPLE)
APPLY_DEFAULT_APPLE_CONFIGURATION()
ENDIF(APPLE)
# Disable -Werror on Unix for now.
SET(CXX_DISABLE_WERROR True)
SET(CMAKE_VERBOSE_MAKEFILE True)
SETUP_PROJECT()
IF(WIN32)
SET(LINK copy_if_different)
ELSE(WIN32)
SET(LINK create_symlink)
ENDIF(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
set(CMAKE_BUILD_TYPE RELEASE)
OPTION (INITIALIZE_WITH_NAN "Initialize Eigen entries with NaN" OFF)
OPTION (EIGEN_RUNTIME_NO_MALLOC "If ON, it can assert in case of runtime allocation" ON)
OPTION (EIGEN_NO_AUTOMATIC_RESIZING "If ON, it forbids automatic resizing of dynamics arrays and matrices" OFF)
ADD_REQUIRED_DEPENDENCY("eigen3 >= 3.2.0")
SEARCH_FOR_BOOST()
set (VREP_ROOT
$ENV{HOME}/vrep/
CACHE "VRep root dir" STRING)
include_directories(
${EIGEN3_INCLUDE_DIR}
${RBDL_INCLUDE_DIR}
${VREP_ROOT}/programming/include
${VREP_ROOT}/programming/remoteApi
${Boost_INCLUDE_DIR}
${VREP_PATH}/remoteApi
${VREP_PATH}/include
)
if(MSVC)
add_definitions(-DBOOST_ALL_NO_LIB)
endif()
add_definitions(-DBOOST_TEST_DYN_LINK)
SET(${PROJECT_NAME}_TASKS_HEADERS
include/tasks/task-base.h
include/tasks/task-joint-bounds.h
include/tasks/task-joint-posture.h
include/tasks/task-mobile.h
include/tasks/task-motion.h
include/tasks/task-operational.h
)
SET(${PROJECT_NAME}_CONSTRAINT_HEADERS
include/constraint/constraint-base.h
include/constraint/constraint-bound.h
include/constraint/constraint-equality.h
include/constraint/constraint-inequality.h
include/constraint/fwd_constraints.h
)
SET(${PROJECT_NAME}_TRAJECTORY_HEADERS
include/trajectories/trajectory-base.h
include/trajectories/trajectory-jointspace.h
include/trajectories/trajectory-operationalspace.h
)
SET(${PROJECT_NAME}_SOLVERS_HEADERS
include/solvers/eiquadprog_2011.h
include/solvers/fwd_solver.h
include/solvers/solver-HQP-base.h
include/solvers/solver-HQP-eiquadprog.h
include/solvers/solver-HQP-factory.h
include/solvers/solver-HQP-factory.hxx
include/solvers/solver-HQP-output.h
include/solvers/solver-HQP-qpoases.h
include/solvers/solver-utils.h
)
SET(${PROJECT_NAME}_CONTROLLER_HEADERS
include/controller/Inverse-dynamics.h
)
SET(${PROJECT_NAME}_ROBOT_HEADERS
include/robot/robot_model.h
)
SET(${PROJECT_NAME}_UTILS_HEADERS
include/utils/container.h
include/utils/motion.h
include/utils/utils.h
)
SET(${PROJECT_NAME}_VREP_BRIDGE_HEADERS
include/vrep_bridge/vrep_bridge.h
include/vrep_bridge/shared_memory.h
)
SET(HEADERS
include/fwd.h
${${PROJECT_NAME}_TASKS_HEADERS}
${${PROJECT_NAME}_CONSTRAINT_HEADERS}
${${PROJECT_NAME}_TRAJECTORY_HEADERS}
${${PROJECT_NAME}_SOLVERS_HEADERS}
${${PROJECT_NAME}_CONTROLLER_HEADERS}
${${PROJECT_NAME}_UTILS_HEADERS}
${${PROJECT_NAME}_VREP_BRIDGE_HEADERS}
${${PROJECT_NAME}_ROBOT_HEADERS}
)
LIST(REMOVE_DUPLICATES HEADERS)
SET(HEADERS_FULL_PATH "")
FOREACH(header ${HEADERS})
LIST(APPEND HEADERS_FULL_PATH "${CMAKE_SOURCE_DIR}/${header}")
GET_FILENAME_COMPONENT(headerName ${header} NAME)
GET_FILENAME_COMPONENT(headerPath ${header} PATH)
INSTALL(FILES ${${PROJECT_NAME}_SOURCE_DIR}/${header}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${headerPath}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
ENDFOREACH(header ${HEADERS})
add_definitions (-DNON_MATLAB_PARSING)
add_definitions (-DMAX_EXT_API_CONNECTIONS=255)
#add_definitions (-DDO_NOT_USE_SHARED_MEMORY)
add_definitions (-Ddof=7)
ADD_SUBDIRECTORY(src)
add_library(vrep_lib
${VREP_ROOT}/programming/remoteApi/extApi.c
${VREP_ROOT}/programming/remoteApi/extApiPlatform.c
${VREP_ROOT}/programming/common/shared_memory.c
)
add_executable(test_hqp demo-hqp/demo.cpp)
PKG_CONFIG_USE_DEPENDENCY(test_hqp eigen3)
target_link_libraries(test_hqp HQP rbdl qpOASES pthread -lrt vrep_lib )