diff --git a/core/roslib/CMakeLists.txt b/core/roslib/CMakeLists.txt index 08e9092c..93556751 100644 --- a/core/roslib/CMakeLists.txt +++ b/core/roslib/CMakeLists.txt @@ -35,11 +35,9 @@ catkin_project(roslib ) #integration tests -find_package(GTest) -if(GTEST_FOUND) - add_gtest(${PROJECT_NAME}-utest test/utest.cpp) - target_link_libraries(${PROJECT_NAME}-utest roslib ${Boost_LIBRARIES} ${ROS_LIBRARIES}) - add_gtest(${PROJECT_NAME}-test_package test/package.cpp) - target_link_libraries(${PROJECT_NAME}-test_package roslib ${ROS_LIBRARIES}) -endif(GTEST_FOUND) +add_gtest(${PROJECT_NAME}-utest test/utest.cpp) +target_link_libraries(${PROJECT_NAME}-utest roslib ${Boost_LIBRARIES} ${ROS_LIBRARIES}) + +add_gtest(${PROJECT_NAME}-test_package test/package.cpp) +target_link_libraries(${PROJECT_NAME}-test_package roslib ${ROS_LIBRARIES}) diff --git a/tools/rosunit/cmake/rosunit-extras.cmake.in b/tools/rosunit/cmake/rosunit-extras.cmake.in index 0cc32fa4..b5ac6d36 100644 --- a/tools/rosunit/cmake/rosunit-extras.cmake.in +++ b/tools/rosunit/cmake/rosunit-extras.cmake.in @@ -104,7 +104,10 @@ function(add_gtest exe) endif() # Create the program, with basic + gtest build flags - find_package(GTest REQUIRED) + find_package(GTest) + if(NOT GTEST_FOUND) + message("Warning: GTest not found; C++ tests will fail to build.") + endif() include_directories(${GTEST_INCLUDE_DIRS}) add_executable(${exe} EXCLUDE_FROM_ALL ${_gtest_DEFAULT_ARGS}) target_link_libraries(${exe} ${GTEST_LIBRARIES} ${THREADS_LIBRARY})