@@ -22,11 +22,23 @@ find_package(catkin REQUIRED COMPONENTS
22
22
cmake_modules
23
23
)
24
24
25
- find_package (yaml-cpp REQUIRED)
25
+ # Resolve system dependency on yaml-cpp, which apparently does not
26
+ # provide a CMake find_package() module.
27
+ find_package (PkgConfig REQUIRED)
28
+ pkg_check_modules(YAML_CPP REQUIRED yaml-cpp)
29
+ find_path (YAML_CPP_INCLUDE_DIR
30
+ NAMES yaml_cpp.h
31
+ PATHS ${YAML_CPP_INCLUDE_DIRS}
32
+ )
33
+ find_library (YAML_CPP_LIBRARY
34
+ NAMES YAML_CPP
35
+ PATHS ${YAML_CPP_LIBRARY_DIRS}
36
+ )
37
+ link_directories (${YAML_CPP_LIBRARY_DIRS} )
26
38
27
- # find_package(PkgConfig REQUIRED )
28
- # pkg_check_modules(YAML_CPP REQUIRED yaml-cpp )
29
- # pkg_check_modules(yaml_cpp yaml-cpp REQUIRED )
39
+ if ( NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5" )
40
+ add_definitions (-DHAVE_NEW_YAMLCPP )
41
+ endif ( NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5" )
30
42
31
43
################################################################################
32
44
# Setup for python modules and scripts
@@ -47,7 +59,6 @@ catkin_package(
47
59
INCLUDE_DIRS include
48
60
LIBRARIES robotis_controller
49
61
CATKIN_DEPENDS roscpp roslib std_msgs sensor_msgs robotis_controller_msgs dynamixel_sdk robotis_device robotis_framework_common cmake_modules
50
- DEPENDS YAML_CPP
51
62
)
52
63
53
64
################################################################################
@@ -56,12 +67,12 @@ catkin_package(
56
67
include_directories (
57
68
include
58
69
${catkin_INCLUDE_DIRS}
59
- ${yaml_cpp_INCLUDE_DIRS }
70
+ ${YAML_CPP_INCLUDE_DIRS }
60
71
)
61
72
62
73
add_library (robotis_controller src/robotis_controller/robotis_controller.cpp)
63
74
add_dependencies (robotis_controller ${catkin_EXPORTED_TARGETS} )
64
- target_link_libraries (robotis_controller ${yaml_cpp_LIBRARIES } ${catkin_LIBRARIES } )
75
+ target_link_libraries (robotis_controller ${catkin_LIBRARIES } ${YAML_CPP_LIBRARIES } )
65
76
66
77
################################################################################
67
78
# Install
0 commit comments