build: add BUILD_ROBOT_SBPL_TESTS option, off by default
test_sbpl and test_adjacency_list were always built, also in the standalone pnkx_nav_core build that is deployed to the robot. Enable them with -DBUILD_ROBOT_SBPL_TESTS=ON.
This commit is contained in:
@@ -91,8 +91,15 @@ install(EXPORT robot_sbpl-targets
|
||||
NAMESPACE robot_sbpl::
|
||||
DESTINATION lib/cmake/robot_sbpl)
|
||||
|
||||
add_executable(test_sbpl src/test/main.cpp)
|
||||
target_link_libraries(test_sbpl robot_sbpl)
|
||||
# Test programs are OFF by default: the standalone pnkx_nav_core build (the robot deployment
|
||||
# path) pulls this directory in, and must not produce them. Enable with -DBUILD_ROBOT_SBPL_TESTS=ON
|
||||
# to get test_sbpl (README.txt usage) and test_adjacency_list.
|
||||
option(BUILD_ROBOT_SBPL_TESTS "Build the robot_sbpl test programs" OFF)
|
||||
|
||||
add_executable(test_adjacency_list src/test/test_adjacency_list.cpp)
|
||||
target_link_libraries(test_adjacency_list robot_sbpl)
|
||||
if(BUILD_ROBOT_SBPL_TESTS)
|
||||
add_executable(test_sbpl src/test/main.cpp)
|
||||
target_link_libraries(test_sbpl robot_sbpl)
|
||||
|
||||
add_executable(test_adjacency_list src/test/test_adjacency_list.cpp)
|
||||
target_link_libraries(test_adjacency_list robot_sbpl)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user