add CMake support to build gtest

This commit is contained in:
erwincoumans
2014-04-08 09:04:32 -07:00
parent a981c3382b
commit a50dfe8e19
3 changed files with 21 additions and 2 deletions

View File

@@ -270,10 +270,10 @@ ENDIF(INSTALL_LIBS)
# OPTION(INSTALL_EXTRA_LIBS "Set when you want extra libraries installed" OFF)
#ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
OPTION(BUILD_UNIT_TESTS "Build Unit Tests" OFF)
OPTION(BUILD_UNIT_TESTS "Build Unit Tests" ON)
IF (BUILD_UNIT_TESTS)
SUBDIRS(UnitTests)
SUBDIRS(test)
ENDIF()
set (BULLET_CONFIG_CMAKE_PATH lib${LIB_SUFFIX}/cmake/bullet )

3
test/CMakeLists.txt Normal file
View File

@@ -0,0 +1,3 @@
#SUBDIRS( gtest-1.7.0 TestBullet3OpenCL)
SUBDIRS( gtest-1.7.0 )

View File

@@ -0,0 +1,16 @@
INCLUDE_DIRECTORIES(
.
include
)
SET(gtest-1.7.0_SRCS
src/gtest-all.cc
)
#ADD_DEFINITIONS(-DGTEST_HAS_PTHREAD=1)
ADD_DEFINITIONS(-D_VARIADIC_MAX=10)
FILE(GLOB_RECURSE gtest-1.7.0_HDRS "*.h")
ADD_LIBRARY(gtest ${gtest-1.7.0_SRCS} ${gtest-1.7.0_HDRS})