skips tests on systems without git
parent
99e45b995b
commit
69b9bfec51
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue