ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I build gmock manually and replace GTEST_LIBRARIES after find_package(catkin). This is not clean solution but it works in Ubuntu 14.04 and Indigo.

find_package(catkin REQUIRED)
...
# Build gmock
set(gmock_SOURCE_DIR /usr/src/gmock)
include_directories(${gmock_SOURCE_DIR}/include
                    ${gmock_SOURCE_DIR}
                    ${gmock_SOURCE_DIR}/gtest/include
                    ${gmock_SOURCE_DIR}/gtest)
add_library(gmock
            ${gmock_SOURCE_DIR}/gtest/src/gtest-all.cc
            ${gmock_SOURCE_DIR}/src/gmock-all.cc)
target_link_libraries(gmock pthread)
# Replace catkin variable
set(GTEST_LIBRARIES gmock)
...
catkin_add_gtest(${PROJECT_NAME}-test test/test_sample.cpp)