diff --git a/mav_trajectory_generation/CMakeLists.txt b/mav_trajectory_generation/CMakeLists.txt index 2b15960e..1035088c 100644 --- a/mav_trajectory_generation/CMakeLists.txt +++ b/mav_trajectory_generation/CMakeLists.txt @@ -47,15 +47,17 @@ target_link_libraries(polynomial_timing_evaluation ${PROJECT_NAME}) ######### # TESTS # ######### -catkin_add_gtest(test_polynomial - test/test_polynomial.cpp -) -target_link_libraries(test_polynomial ${PROJECT_NAME} ${catkin_LIBRARIES}) +if (CATKIN_ENABLE_TESTING) + catkin_add_gtest(test_polynomial + test/test_polynomial.cpp + ) + target_link_libraries(test_polynomial ${PROJECT_NAME} ${catkin_LIBRARIES}) -catkin_add_gtest(test_polynomial_optimization - test/test_polynomial_optimization.cpp -) -target_link_libraries(test_polynomial_optimization ${PROJECT_NAME} ${catkin_LIBRARIES}) + catkin_add_gtest(test_polynomial_optimization + test/test_polynomial_optimization.cpp + ) + target_link_libraries(test_polynomial_optimization ${PROJECT_NAME} ${catkin_LIBRARIES}) +endif() ########## # EXPORT # diff --git a/mav_trajectory_generation_ros/CMakeLists.txt b/mav_trajectory_generation_ros/CMakeLists.txt index f80efc05..8d3100d7 100644 --- a/mav_trajectory_generation_ros/CMakeLists.txt +++ b/mav_trajectory_generation_ros/CMakeLists.txt @@ -48,10 +48,12 @@ target_link_libraries(time_evaluation_node ${PROJECT_NAME}) ######### # TESTS # ######### -catkin_add_gtest(test_feasibility - test/test_feasibility.cpp -) -target_link_libraries(test_feasibility ${PROJECT_NAME} ${catkin_LIBRARIES}) +if (CATKIN_ENABLE_TESTING) + catkin_add_gtest(test_feasibility + test/test_feasibility.cpp + ) + target_link_libraries(test_feasibility ${PROJECT_NAME} ${catkin_LIBRARIES}) +endif() ########## # EXPORT #