Skip to content

Commit f5a4dd6

Browse files
committed
Replace deprecated include_directories in cmake
1 parent 3ff6a32 commit f5a4dd6

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.16.3) # version on Ubuntu Focal
1+
cmake_minimum_required(VERSION 3.20)
22

33
project(behaviortree_cpp VERSION 4.9.0 LANGUAGES C CXX)
44

‎examples/CMakeLists.txt‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
include_directories( ../sample_nodes )
2-
31
set(CMAKE_DEBUG_POSTFIX "")
42

53
function(CompileExample name)
@@ -11,10 +9,12 @@ endfunction()
119
# The plugin libdummy_nodes.so can be linked statically or
1210
# loaded dynamically at run-time.
1311
add_executable(t01_first_tree_static t01_build_your_first_tree.cpp )
12+
target_include_directories(t01_first_tree_static PRIVATE ../sample_nodes)
1413
target_compile_definitions(t01_first_tree_static PRIVATE "MANUAL_STATIC_LINKING")
1514
target_link_libraries(t01_first_tree_static ${BTCPP_LIBRARY} bt_sample_nodes )
1615

1716
add_executable(t01_first_tree_dynamic t01_build_your_first_tree.cpp )
17+
target_include_directories(t01_first_tree_dynamic PRIVATE ../sample_nodes)
1818
target_link_libraries(t01_first_tree_dynamic ${BTCPP_LIBRARY} )
1919

2020
CompileExample("t02_basic_ports")
@@ -47,6 +47,23 @@ if(BTCPP_SQLITE_LOGGING)
4747
CompileExample("ex03_sqlite_log")
4848
endif()
4949

50+
set(SAMPLE_NODE_EXAMPLES
51+
t02_basic_ports
52+
t04_reactive_sequence
53+
t05_crossdoor
54+
t06_subtree_port_remapping
55+
t07_load_multiple_xml
56+
t09_scripting
57+
t11_groot_howto
58+
t15_nodes_mocking
59+
t17_blackboard_backup
60+
ex03_sqlite_log)
61+
foreach(EXAMPLE IN LISTS SAMPLE_NODE_EXAMPLES)
62+
if(TARGET ${EXAMPLE})
63+
target_include_directories(${EXAMPLE} PRIVATE ../sample_nodes)
64+
endif()
65+
endforeach()
66+
5067

5168
############ Create plugin and executor in folder plugin_example ##########
5269

0 commit comments

Comments
 (0)