diff --git a/CMakeLists.txt b/CMakeLists.txt index d88734e4..2cea0223 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,33 +41,19 @@ find_package(Protobuf QUIET CONFIG) if(${Protobuf_FOUND}) message(STATUS "Modern protobuf library located.") set(ABSL_INCLUDED_WITH_PROTOBUF ON) - set(GOOGLETEST_INCLUDED_WITH_ABSL OFF) + set(GOOGLTEST_INCLUDED_WITH_PROTOBUF OFF) else() find_package(Protobuf QUIET) if(${Protobuf_FOUND}) message(STATUS "Legacy protobuf library located.") include_directories(${Protobuf_INCLUDE_DIRS}) set(ABSL_INCLUDED_WITH_PROTOBUF OFF) - set(GOOGLETEST_INCLUDED_WITH_ABSL OFF) + set(GOOGLTEST_INCLUDED_WITH_PROTOBUF OFF) else() message(STATUS "Fetching external protobuf library.") include(third_party/protobuf.cmake) - #find_package(Protobuf CONFIG REQUIRED) - #include_directories(${Protobuf_INCLUDE_DIRS}) set(ABSL_INCLUDED_WITH_PROTOBUF ON) - set(GOOGLETEST_INCLUDED_WITH_ABSL ON) - #find_package(GTest) - #if(NOT {$GTest_FOUND}) - # message(FATAL_ERROR "GTest package not found.") - #endif() - #find_library(GTEST_LIB GTest) - #if(NOT GTEST_LIB) - # message(FATAL_ERROR "GTest was unexpectedly not included in Protobuf.") - #endif() - #find_library(GMOCK_LIB GTest::gmock) - #if(NOT GMOCK_LIB) - # message(FATAL_ERROR "GMock was not built as part of GoogleTest.") - #endif() + set(GOOGLTEST_INCLUDED_WITH_PROTOBUF ON) endif() endif() diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 64587202..379fb12b 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -9,7 +9,7 @@ include(datetime.cmake) add_subdirectory(fmt) -if(NOT ${GOOGLETEST_INCLUDED_WITH_ABSL}) +if(NOT ${GOOGLTEST_INCLUDED_WITH_PROTOBUF}) add_subdirectory(googletest) endif() diff --git a/third_party/protobuf.cmake b/third_party/protobuf.cmake index 30c63a2f..e7942cf3 100644 --- a/third_party/protobuf.cmake +++ b/third_party/protobuf.cmake @@ -13,7 +13,6 @@ FetchContent_Declare(GTest FetchContent_Declare(Protobuf GIT_REPOSITORY https://github.com/protocolbuffers/protobuf.git GIT_TAG v23.4 - #SOURCE_SUBDIR cmake OVERRIDE_FIND_PACKAGE ) set(protobuf_BUILD_TESTS OFF CACHE INTERNAL "")