Skip to content

Commit

Permalink
fix the GTest with catkin again
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud committed Jul 23, 2012
1 parent be3e0c4 commit e8e5da3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmake/tools/gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ find_package(GTest QUIET)
set(GTEST_FOUND ${GTEST_FOUND} CACHE INTERNAL "")
if(NOT GTEST_FOUND)
if (EXISTS "/usr/src/gtest")
message(INFO "Building GTest from source.")
# for now, this would only work on Ubuntu
add_subdirectory("/usr/src/gtest/" ${CMAKE_BINARY_DIR}/gtest)
set(CATKIN_GTEST_SRC_FOUND TRUE)
set(GTEST_LIBRARIES "gtest;gtest_main")
find_path(GTEST_INCLUDE_DIRS gtest/gtest.h)
set(GTEST_MAIN_LIBRARIES ${GTEST_LIBRARIES})
set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES})
set(GTEST_FOUND TRUE)
else()
message(WARNING "GTest not found; C++ tests will fail to build.")
endif()
Expand Down

0 comments on commit e8e5da3

Please sign in to comment.