Skip to content

Commit b7c2d9b

Browse files
author
Davide Faconti
committed
fix issue BehaviorTree#251
1 parent a263452 commit b7c2d9b

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

CMakeLists.txt

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,22 @@ endif()
1515

1616
#---- Include boost to add coroutines ----
1717
find_package(Boost COMPONENTS coroutine QUIET)
18+
1819
if(Boost_FOUND)
19-
include_directories(${Boost_INCLUDE_DIRS})
2020
string(REPLACE "." "0" Boost_VERSION_NODOT ${Boost_VERSION})
2121
if(NOT Boost_VERSION_NODOT VERSION_LESS 105900)
2222
message(STATUS "Found boost::coroutine2.")
2323
add_definitions(-DBT_BOOST_COROUTINE2)
2424
set(BT_COROUTINES true)
2525
elseif(NOT Boost_VERSION_NODOT VERSION_LESS 105300)
2626
message(STATUS "Found boost::coroutine.")
27-
include_directories(${Boost_INCLUDE_DIRS})
2827
add_definitions(-DBT_BOOST_COROUTINE)
2928
set(BT_COROUTINES true)
3029
endif()
3130
endif()
3231

32+
include_directories(${Boost_INCLUDE_DIRS})
33+
3334
if(NOT DEFINED BT_COROUTINES)
3435
message(STATUS "Coroutines disabled. Install Boost to enable them (version 1.59+ recommended).")
3536
add_definitions(-DBT_NO_COROUTINES)
@@ -47,16 +48,15 @@ option(BUILD_SHARED_LIBS "Build shared libraries" ON)
4748
find_package(Threads)
4849
find_package(ZMQ)
4950

50-
list(APPEND BEHAVIOR_TREE_EXTERNAL_LIBRARIES
51+
list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES
5152
${CMAKE_THREAD_LIBS_INIT}
5253
${CMAKE_DL_LIBS}
53-
${Boost_LIBRARIES} )
54+
)
5455

5556
if( ZMQ_FOUND )
5657
message(STATUS "ZeroMQ found.")
5758
add_definitions( -DZMQ_FOUND )
5859
list(APPEND BT_SOURCE src/loggers/bt_zmq_publisher.cpp)
59-
list(APPEND BEHAVIOR_TREE_EXTERNAL_LIBRARIES ${ZMQ_LIBRARIES})
6060
else()
6161
message(WARNING "ZeroMQ NOT found. Skipping the build of [PublisherZMQ] and [bt_recorder].")
6262
endif()
@@ -98,7 +98,7 @@ elseif( CATKIN_DEVEL_PREFIX OR CATKIN_BUILD_BINARY_PACKAGE)
9898
CATKIN_DEPENDS roslib
9999
)
100100

101-
list(APPEND BEHAVIOR_TREE_EXTERNAL_LIBRARIES ${catkin_LIBRARIES})
101+
list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES ${catkin_LIBRARIES})
102102
set(BUILD_TOOL_INCLUDE_DIRS ${catkin_INCLUDE_DIRS})
103103

104104
elseif(BUILD_UNIT_TESTS)
@@ -181,7 +181,7 @@ if(CURSES_FOUND)
181181
list(APPEND BT_SOURCE
182182
src/controls/manual_node.cpp
183183
)
184-
list(APPEND BEHAVIOR_TREE_EXTERNAL_LIBRARIES ${CURSES_LIBRARIES})
184+
list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES ${CURSES_LIBRARIES})
185185
add_definitions(-DNCURSES_FOUND)
186186
endif()
187187

@@ -208,7 +208,17 @@ if( ZMQ_FOUND )
208208
endif()
209209

210210
target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC
211-
${BEHAVIOR_TREE_EXTERNAL_LIBRARIES})
211+
${BEHAVIOR_TREE_PUBLIC_LIBRARIES})
212+
213+
target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PRIVATE
214+
${Boost_LIBRARIES}
215+
${ZMQ_LIBRARIES})
216+
217+
#get_target_property(my_libs ${BEHAVIOR_TREE_LIBRARY} INTERFACE_LINK_LIBRARIES)
218+
#list(REMOVE_ITEM _libs X)
219+
#message("my_libs: ${my_libs}")
220+
221+
#set_target_properties(${BEHAVIOR_TREE_LIBRARY} PROPERTIES INTERFACE_LINK_LIBRARIES "")
212222

213223
target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PRIVATE $<$<CONFIG:Debug>:TINYXML2_DEBUG>)
214224

tools/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ install(TARGETS bt3_log_cat
88

99
if( ZMQ_FOUND )
1010
add_executable(bt3_recorder bt_recorder.cpp )
11-
target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} )
11+
target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZMQ_LIBRARIES})
1212
install(TARGETS bt3_recorder
1313
DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} )
1414
endif()

0 commit comments

Comments
 (0)