skips tests on systems without git

pull/577/head
Peter LaValle 2015-05-31 13:14:16 +01:00
parent 99e45b995b
commit 69b9bfec51
2 changed files with 38 additions and 28 deletions

View File

@ -30,6 +30,13 @@ endif()
set(GTEST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gtest")
# try to find git - if found, setup gtest
find_package(Git)
if(NOT GIT_FOUND)
set(AddGTest_FOUND false CACHE BOOL "Was gtest setup correctly?")
else(NOT GIT_FOUND)
set(AddGTest_FOUND true CACHE BOOL "Was gtest setup correctly?")
ExternalProject_Add(gtest
GIT_REPOSITORY https://chromium.googlesource.com/external/googletest
TIMEOUT 10
@ -62,3 +69,4 @@ include_directories(${source_dir}/gtest/include)
ExternalProject_Get_Property(gtest binary_dir)
link_directories(${binary_dir})
endif(NOT GIT_FOUND)

View File

@ -46,6 +46,7 @@ SET( TEST_SRCS
SOURCE_GROUP( tests FILES ${TEST_SRCS} )
if(AddGTest_FOUND)
add_executable( unit
unit/CCompilerTest.c
unit/Main.cpp
@ -60,5 +61,6 @@ target_link_libraries( unit assimp
debug ${GTEST_DEBUG_LIBRARIES}
optimized ${GTEST_RELEASE_LIBRARIES}
)
endif(AddGTest_FOUND)
add_subdirectory(headercheck)