diff --git a/CMakeLists.txt b/CMakeLists.txt index 971984e..cb5df2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()