FindWrapGTest.cmake 476 B

123456789101112131415
  1. cmake_minimum_required(VERSION 3.10)
  2. find_package(GTest QUIET)
  3. unset(WrapGTest_FOUND)
  4. if(NOT GTest_FOUND)
  5. if(EXISTS "${QT_PROTOBUF_SOURCE_DIR}/3rdparty/googletest/CMakeLists.txt")
  6. set(BUILD_GMOCK OFF CACHE BOOL "" FORCE)
  7. set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
  8. add_subdirectory("${QT_PROTOBUF_SOURCE_DIR}/3rdparty/googletest" EXCLUDE_FROM_ALL)
  9. set(WrapGTest_FOUND TRUE)
  10. endif()
  11. else()
  12. set(WrapGTest_FOUND TRUE)
  13. endif()