Skip to content

Commit

Permalink
Cleaned up.
Browse files Browse the repository at this point in the history
  • Loading branch information
EpsilonPrime committed Feb 21, 2024
1 parent 7853b51 commit 60562ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
20 changes: 3 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
1 change: 0 additions & 1 deletion third_party/protobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down

0 comments on commit 60562ae

Please sign in to comment.