From 3292f2b6827f046d0a5f36e5973c99d22fec7b7e Mon Sep 17 00:00:00 2001 From: William Woodall Date: Wed, 31 Jul 2013 16:47:19 -0700 Subject: [PATCH] Fix up linking on Linux for the tests Conflicts: CMakeLists.txt tests/serial_tests.cc --- CMakeLists.txt | 9 +++++++-- tests/serial_tests.cc | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 862d01d..627e5ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,5 +58,10 @@ install(FILES include/serial/serial.h include/serial/v8stdint.h DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/serial) ## Tests -catkin_add_gtest(${PROJECT_NAME}-test tests/serial_tests.cc) -target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) +if(CATKIN_ENABLE_TESTING) + catkin_add_gtest(${PROJECT_NAME}-test tests/serial_tests.cc) + target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME} ${Boost_LIBRARIES}) + if(UNIX AND NOT APPLE) + target_link_libraries(${PROJECT_NAME}-test util) + endif() +endif() diff --git a/tests/serial_tests.cc b/tests/serial_tests.cc index 1cee260..26ffde2 100644 --- a/tests/serial_tests.cc +++ b/tests/serial_tests.cc @@ -29,7 +29,7 @@ void loop() #include "serial/serial.h" -#ifdef __linux__ +#if defined(__linux__) #include #else #include -- 2.42.0