-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
106 lines (82 loc) · 3.88 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
project(GazeboXBotPlugin)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
find_package(gazebo REQUIRED)
find_package(XBotCoreModel REQUIRED)
find_package(XCM REQUIRED)
find_package(boost QUIET)
find_package(sharedlibpp REQUIRED)
find_package(kdl_parser REQUIRED)
include_directories(include
${GAZEBO_INCLUDE_DIRS}
${XBotCoreModel_INCLUDE_DIRS}
${kdl_parser_INCLUDE_DIRS}
${sharedlibpp_INCLUDE_DIRS}
${XCM_INCLUDE_DIRS}
)
link_directories(${GAZEBO_LIBRARY_DIRS} )
list(APPEND CMAKE_CXX_FLAGS "${GAZEBO_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")
# C++ 11
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
# JointController
add_library(JointController SHARED src/JointController.cpp)
target_link_libraries(JointController ${GAZEBO_LIBRARIES} )
add_library(JointImpedanceController SHARED src/JointImpedanceController.cpp)
target_link_libraries(JointImpedanceController JointController ${GAZEBO_LIBRARIES} )
add_library(DefaultGazeboPID SHARED src/DefaultGazeboPID.cpp)
target_link_libraries(DefaultGazeboPID JointController ${GAZEBO_LIBRARIES} )
add_library(GazeboXBotJoint SHARED src/GazeboXBotJoint.cpp)
target_link_libraries(GazeboXBotJoint ${GAZEBO_LIBRARIES}
yaml-cpp
JointImpedanceController )
add_library(GazeboXBotImu SHARED src/GazeboXBotImu.cpp)
target_link_libraries(GazeboXBotImu ${GAZEBO_LIBRARIES} )
add_library(GazeboXBotFt SHARED src/GazeboXBotFt.cpp)
target_link_libraries(GazeboXBotFt ${GAZEBO_LIBRARIES} )
add_library(GazeboXBotHand SHARED src/GazeboXBotHand.cpp)
target_link_libraries(GazeboXBotHand ${GAZEBO_LIBRARIES} )
# GazeboXBotPlugin
add_library(GazeboXBotPlugin SHARED src/GazeboXBotPlugin.cpp)
target_link_libraries(GazeboXBotPlugin ${GAZEBO_LIBRARIES}
${Boost_LIBRARIES}
${XBotCoreModel_LIBRARIES}
${sharedlibpp_LIBRARIES}
${XCM_LIBRARIES}
yaml-cpp
JointController
DefaultGazeboPID
JointImpedanceController
GazeboXBotJoint
GazeboXBotImu
GazeboXBotFt
GazeboXBotHand
)
install(TARGETS GazeboXBotPlugin RUNTIME LIBRARY DESTINATION lib)
install(DIRECTORY include/
DESTINATION include
FILES_MATCHING PATTERN "*.h*")
install(TARGETS JointController RUNTIME LIBRARY DESTINATION lib)
install(DIRECTORY include/
DESTINATION include
FILES_MATCHING PATTERN "*.h*")
install(TARGETS JointImpedanceController RUNTIME LIBRARY DESTINATION lib)
install(DIRECTORY include/
DESTINATION include
FILES_MATCHING PATTERN "*.h*")
install(TARGETS DefaultGazeboPID RUNTIME LIBRARY DESTINATION lib)
install(DIRECTORY include/
DESTINATION include
FILES_MATCHING PATTERN "*.h*")
install(TARGETS GazeboXBotJoint RUNTIME LIBRARY DESTINATION lib)
install(TARGETS GazeboXBotImu RUNTIME LIBRARY DESTINATION lib)
install(TARGETS GazeboXBotFt RUNTIME LIBRARY DESTINATION lib)
install(TARGETS GazeboXBotHand RUNTIME LIBRARY DESTINATION lib)