Skip to content

Commit aa375b7

Browse files
authored
add option to conditionally build manual selector node (BehaviorTree#397)
* add option to conditionally build manual selector node Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com> * do not fail if BUILD_MANUAL_SELECTOR is true but Curses is not found Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com>
1 parent 23568cb commit aa375b7

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

CMakeLists.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ option(BUILD_SAMPLES "Build sample nodes" ON)
2323
option(BUILD_UNIT_TESTS "Build the unit tests" ON)
2424
option(BUILD_TOOLS "Build commandline tools" ON)
2525
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
26+
option(BUILD_MANUAL_SELECTOR "Build manual selector node" ON)
2627
option(ENABLE_COROUTINES "Enable boost coroutines" ON)
2728

2829
#---- Include boost to add coroutines ----
@@ -166,14 +167,17 @@ list(APPEND BT_SOURCE
166167
3rdparty/minitrace/minitrace.cpp
167168
)
168169

169-
find_package(Curses QUIET)
170-
171-
if(CURSES_FOUND)
172-
list(APPEND BT_SOURCE
173-
src/controls/manual_node.cpp
174-
)
175-
list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES ${CURSES_LIBRARIES})
176-
add_definitions(-DNCURSES_FOUND)
170+
if(BUILD_MANUAL_SELECTOR)
171+
find_package(Curses QUIET)
172+
if(CURSES_FOUND)
173+
list(APPEND BT_SOURCE
174+
src/controls/manual_node.cpp
175+
)
176+
list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES ${CURSES_LIBRARIES})
177+
add_definitions(-DNCURSES_FOUND)
178+
else()
179+
message(WARNING "NCurses NOT found. Skipping the build of manual selector node.")
180+
endif()
177181
endif()
178182

179183

0 commit comments

Comments
 (0)