Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b751232

Browse files
author
Victor Lopez
committed
If backward_ros is present, use it to avoid duplicate symbols
1 parent f1d89c8 commit b751232

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ elseif( CATKIN_DEVEL_PREFIX OR CATKIN_BUILD_BINARY_PACKAGE)
7373
list(APPEND BEHAVIOR_TREE_EXTERNAL_LIBRARIES ${catkin_LIBRARIES})
7474
set(BUILD_TOOL_INCLUDE_DIRS ${catkin_INCLUDE_DIRS})
7575

76+
find_package(backward_ros QUIET)
77+
if (backward_ros_FOUND)
78+
message(STATUS "backward_ros found, using it.")
79+
list(APPEND BEHAVIOR_TREE_EXTERNAL_LIBRARIES ${catkin_LIBRARIES} ${backward_ros_LIBRARIES})
80+
endif()
81+
7682
else()
7783
find_package(GTest)
7884

@@ -124,8 +130,11 @@ list(APPEND BT_SOURCE
124130

125131
3rdparty/tinyXML2/tinyxml2.cpp
126132
3rdparty/minitrace/minitrace.cpp
127-
3rdparty/backward-cpp/backward.cpp
128133
)
134+
if (NOT backward_ros_FOUND)
135+
list(APPEND BT_SOURCE
136+
3rdparty/backward-cpp/backward.cpp)
137+
endif()
129138

130139
######################################################
131140

0 commit comments

Comments
 (0)