Skip to content

Commit

Permalink
Merge pull request #731 from jspricke/gtest_removal
Browse files Browse the repository at this point in the history
Replace gtest with sytem version (closes #717)
  • Loading branch information
taketwo committed Jun 9, 2014
2 parents 135d66b + a0889ba commit 8f41d22
Show file tree
Hide file tree
Showing 33 changed files with 45 additions and 28,780 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ before_install:
- sudo add-apt-repository ppa:libreoffice/ppa -y
- sudo apt-get update -d
install:
- sudo apt-get install libvtk5-qt4-dev libflann-dev libeigen3-dev libopenni-dev libqhull-dev libboost-filesystem1.53-dev libboost-iostreams1.53-dev libboost-thread1.53-dev libboost-chrono1.53-dev libusb-1.0-0-dev
- sudo apt-get install libvtk5-qt4-dev libflann-dev libeigen3-dev libopenni-dev libqhull-dev libboost-filesystem1.53-dev libboost-iostreams1.53-dev libboost-thread1.53-dev libboost-chrono1.53-dev libusb-1.0-0-dev libgtest-dev
script:
- bash .travis.sh
40 changes: 40 additions & 0 deletions cmake/Modules/FindGtest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
###############################################################################
# Find GTest
#
# This sets the following variables:
# GTEST_FOUND - True if GTest was found.
# GTEST_INCLUDE_DIRS - Directories containing the GTest include files.
# GTEST_SRC - Directories containing the GTest source files.

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} /usr /usr/local)
endif(CMAKE_SYSTEM_NAME STREQUAL Linux)
if(APPLE)
list(APPEND CMAKE_INCLUDE_PATH /opt/local)
set(CMAKE_FIND_FRAMEWORK NEVER)
endif()

find_path(GTEST_INCLUDE_DIR gtest/gtest.h
HINTS "${GTEST_ROOT}" "$ENV{GTEST_ROOT}"
PATHS "$ENV{PROGRAMFILES}/gtest" "$ENV{PROGRAMW6432}/gtest"
PATHS "$ENV{PROGRAMFILES}/gtest-1.7.0" "$ENV{PROGRAMW6432}/gtest-1.7.0"
PATH_SUFFIXES gtest include/gtest include)

find_path(GTEST_SRC_DIR src/gtest-all.cc
HINTS "${GTEST_ROOT}" "$ENV{GTEST_ROOT}"
PATHS "$ENV{PROGRAMFILES}/gtest" "$ENV{PROGRAMW6432}/gtest"
PATHS "$ENV{PROGRAMFILES}/gtest-1.7.0" "$ENV{PROGRAMW6432}/gtest-1.7.0"
PATH /usr/src/gtest
PATH_SUFFIXES gtest usr/src/gtest)

set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR})
set(CMAKE_FIND_FRAMEWORK)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Gtest DEFAULT_MSG GTEST_INCLUDE_DIR GTEST_SRC_DIR)

mark_as_advanced(GTEST_INCLUDE_DIR GTEST_SRC_DIR)

if(GTEST_FOUND)
message(STATUS "GTest found (include: ${GTEST_INCLUDE_DIRS}, src: ${GTEST_SRC_DIR})")
endif(GTEST_FOUND)
7 changes: 4 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ PCL_SUBSYS_DEPEND(build "${SUBSYS_NAME}" DEPS ${SUBSYS_DEPS} OPT_DEPS ${OPT_DEPS

if(build)

include_directories("${PCL_SOURCE_DIR}/test/gtest-1.6.0/include"
"${PCL_SOURCE_DIR}/test/gtest-1.6.0/")
add_library(pcl_gtest STATIC gtest-1.6.0/src/gtest-all.cc)
find_package(Gtest REQUIRED)
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS} ${GTEST_SRC_DIR})

add_library(pcl_gtest STATIC ${GTEST_SRC_DIR}/src/gtest-all.cc)

if( MSVC11 ) # VS2012 doesn't correctly support variadic templates yet
add_definitions("-D_VARIADIC_MAX=10")
Expand Down
283 changes: 0 additions & 283 deletions test/gtest-1.6.0/include/gtest/gtest-death-test.h

This file was deleted.

Loading

0 comments on commit 8f41d22

Please sign in to comment.