Skip to content

Commit

Permalink
BehaviorTree#10 Add C++11 property for samples and tests
Browse files Browse the repository at this point in the history
Signed-off-by: Uilian Ries <uilianries@gmail.com>
  • Loading branch information
uilianries committed Nov 17, 2018
1 parent cde64c3 commit 05f69a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ if(catkin_FOUND AND CATKIN_ENABLE_TESTING)
crossdoor_nodes
${catkin_LIBRARIES})
target_include_directories(${BEHAVIOR_TREE_LIBRARY}_test PRIVATE gtest/include)
set_property(TARGET ${PROJECT_NAME}_test PROPERTY CXX_STANDARD 11)

elseif(GTEST_FOUND AND BUILD_UNIT_TESTS)

Expand All @@ -155,6 +156,7 @@ elseif(GTEST_FOUND AND BUILD_UNIT_TESTS)
${GTEST_LIBRARIES}
${GTEST_MAIN_LIBRARIES})
target_include_directories(${BEHAVIOR_TREE_LIBRARY}_test PRIVATE gtest/include ${GTEST_INCLUDE_DIRS})
set_property(TARGET ${PROJECT_NAME}_test PROPERTY CXX_STANDARD 11)

add_test(BehaviorTreeCoreTest ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BEHAVIOR_TREE_LIBRARY}_test)
endif()
Expand Down
6 changes: 6 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,30 @@ cmake_minimum_required(VERSION 2.8)
# This tutorial demonstrates how to compile statically a tree (no factory)
add_executable(t01_programmatic_tree t01_programmatic_tree.cpp )
target_link_libraries(t01_programmatic_tree dummy_nodes ${BEHAVIOR_TREE_LIBRARY} )
set_property(TARGET t01_programmatic_tree PROPERTY CXX_STANDARD 11)

# The plugin libdummy_nodes.so can be linked statically or
# loaded dynamically at run-time.
add_executable(t02_factory_static t02_factory_tree.cpp )
target_compile_definitions(t02_factory_static PRIVATE "MANUAL_STATIC_LINKING")
target_link_libraries(t02_factory_static ${BEHAVIOR_TREE_LIBRARY} dummy_nodes )
set_property(TARGET t02_factory_static PROPERTY CXX_STANDARD 11)

add_executable(t02_factory_dynamic t02_factory_tree.cpp )
target_link_libraries(t02_factory_dynamic ${BEHAVIOR_TREE_LIBRARY} )
set_property(TARGET t02_factory_dynamic PROPERTY CXX_STANDARD 11)


# This tutorial shows how the difference between Sequence and SequenceStar
add_executable(t03_sequence_star t03_sequence_star.cpp )
target_link_libraries(t03_sequence_star movebase_node dummy_nodes ${BEHAVIOR_TREE_LIBRARY} )
set_property(TARGET t03_sequence_star PROPERTY CXX_STANDARD 11)

# This tutorial demonstrates how to use blackboards and NodeParameters
add_executable(t04_blackboard t04_blackboard.cpp )
target_link_libraries(t04_blackboard movebase_node ${BEHAVIOR_TREE_LIBRARY} )
set_property(TARGET t04_blackboard PROPERTY CXX_STANDARD 11)

add_executable(t05_crossdoor t05_crossdoor.cpp )
target_link_libraries(t05_crossdoor crossdoor_nodes ${BEHAVIOR_TREE_LIBRARY} )
set_property(TARGET t05_crossdoor PROPERTY CXX_STANDARD 11)
3 changes: 3 additions & 0 deletions sample_nodes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ include_directories( ../include )
add_library(crossdoor_nodes SHARED crossdoor_nodes.cpp )
target_link_libraries(crossdoor_nodes PRIVATE ${BEHAVIOR_TREE_LIBRARY})
target_include_directories(crossdoor_nodes PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_property(TARGET crossdoor_nodes PROPERTY CXX_STANDARD 11)

add_library(dummy_nodes SHARED dummy_nodes.cpp )
target_link_libraries(dummy_nodes PRIVATE ${BEHAVIOR_TREE_LIBRARY})
target_include_directories(dummy_nodes PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_property(TARGET dummy_nodes PROPERTY CXX_STANDARD 11)

add_library(movebase_node SHARED movebase_node.cpp )
target_link_libraries(movebase_node PRIVATE ${BEHAVIOR_TREE_LIBRARY})
target_include_directories(movebase_node PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_property(TARGET movebase_node PROPERTY CXX_STANDARD 11)

0 comments on commit 05f69a1

Please sign in to comment.