Skip to content

Commit d0e83de

Browse files
author
Davide Faconti
committed
big change: support plugins loading
1 parent e2b643a commit d0e83de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3876
-478
lines changed

CMakeLists.txt

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ if(catkin_FOUND)
3030
else(catkin_FOUND)
3131

3232
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
33-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
33+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
34+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
3435

3536
find_package(GTest)
3637
include_directories(${GTEST_INCLUDE_DIRS})
@@ -54,6 +55,8 @@ set(BT_Source
5455
src/bt_factory.cpp
5556
src/behavior_tree.cpp
5657
src/xml_parsing.cpp
58+
src/shared_library.cpp
59+
src/shared_library_UNIX.cpp
5760

5861
src/decorators/negation_node.cpp
5962
src/decorators/repeat_node.cpp
@@ -75,7 +78,7 @@ set(BT_Source
7578
)
7679
include_directories(include 3rdparty/)
7780

78-
set(BEHAVIOR_TRE_LIBRARIES behavior_tree_core)
81+
set(BEHAVIOR_TREE_LIBRARIES behavior_tree_core)
7982

8083
find_package(ZMQ)
8184

@@ -84,7 +87,7 @@ if( ZMQ_FOUND )
8487
add_definitions( -DZMQ_FOUND )
8588
set(BT_Source ${BT_Source} src/loggers/bt_zmq_publisher.cpp )
8689

87-
set(BEHAVIOR_TRE_LIBRARIES behavior_tree_core zmq)
90+
set(BEHAVIOR_TREE_LIBRARIES behavior_tree_core zmq)
8891
else()
8992
message(WARNING "ZeroMQ NOT found. Skipping the build of [PublisherZMQ] and [bt_recorder].")
9093
endif()
@@ -93,6 +96,8 @@ endif()
9396
# COMPILING LIBRARY
9497
######################################################
9598
add_library(behavior_tree_core STATIC ${BT_Source} )
99+
target_compile_options(behavior_tree_core PRIVATE "-fPIC")
100+
target_link_libraries(behavior_tree_core dl)
96101

97102

98103
######################################################
@@ -120,7 +125,8 @@ elseif(GTEST_FOUND)
120125
target_link_libraries(behavior_tree_core_test
121126
behavior_tree_core
122127
${GTEST_LIBRARIES}
123-
${GTEST_MAIN_LIBRARIES} )
128+
${GTEST_MAIN_LIBRARIES}
129+
crossdoor_nodes)
124130

125131
endif()
126132

@@ -129,28 +135,18 @@ endif()
129135
######################################################
130136

131137
add_executable(bt_log_cat tools/bt_log_cat.cpp )
132-
target_link_libraries(bt_log_cat behavior_tree_core )
138+
target_link_libraries(bt_log_cat ${BEHAVIOR_TREE_LIBRARIES} )
133139

134140
if( ZMQ_FOUND )
135141
add_executable(bt_recorder tools/bt_recorder.cpp )
136-
target_link_libraries(bt_recorder ${BEHAVIOR_TRE_LIBRARIES} )
142+
target_link_libraries(bt_recorder ${BEHAVIOR_TREE_LIBRARIES} )
137143
endif()
138144

139-
function(BuildExample filename)
140-
add_executable(${filename} examples/${filename}.cpp )
141-
target_link_libraries(${filename} ${BEHAVIOR_TRE_LIBRARIES} )
142-
endfunction()
145+
add_executable(bt_plugin_manifest tools/bt_plugin_manifest.cpp )
146+
target_link_libraries(bt_plugin_manifest ${BEHAVIOR_TREE_LIBRARIES} )
143147

144-
BuildExample(tutorial_programmatic_tree)
145-
BuildExample(tutorial_factory_tree)
146-
BuildExample(tutorial_sequence_star)
147-
BuildExample(tutorial_blackboard)
148-
BuildExample(crossdoor_example)
149148

150-
151-
######################################################
152-
# INSTALLATION OF LIBRARY AND EXECUTABLE
153-
######################################################
149+
add_subdirectory(sample_nodes)
150+
add_subdirectory(examples)
154151

155152

156-
#TODO

0 commit comments

Comments
 (0)