unplugged-system/device/google/trout/agl_services_build/cmake/googletest.cmake

17 lines
590 B
CMake

if(NOT trout_GOOGLETEST_ROOT_DIR)
set(trout_GOOGLETEST_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest)
endif()
if(EXISTS "${trout_GOOGLETEST_ROOT_DIR}/CMakeLists.txt")
if(TARGET ${_trout_GOOGLETEST_LIBRARY_NAME})
set(trout_GOOGLETEST_LIBRARIES ${_trout_GOOGLETEST_LIBRARY_NAME})
else()
set(trout_GOOGLETEST_LIBRARIES "gtest")
endif()
if (NOT TARGET ${trout_GOOGLETEST_LIBRARIES})
add_subdirectory(${trout_GOOGLETEST_ROOT_DIR} third_party/googletest)
endif()
else()
message(FATAL_ERROR "${trout_GOOGLETEST_ROOT_DIR}/CMakeLists.txt not found")
endif()