Skip to content

Commit

Permalink
protobuf is really good. holy crap
Browse files Browse the repository at this point in the history
  • Loading branch information
jakoch committed May 25, 2024
1 parent df83b25 commit 281592d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ if(MSVC AND protobuf_MSVC_STATIC_RUNTIME)
endforeach()
endif()

#
# Protobuf is non-trivial to include
# One would assume an automatic pickup of things build by vcpkg, e.g. the protoc executable.
#
set(Protobuf_USE_STATIC_LIBS ON)
set(Protobuf_DIR "${VCPKG_DIR}/share/protobuf")
list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/tools/protobuf")
Expand All @@ -274,6 +278,11 @@ else()
set(PROTOC "${VCPKG_DIR}/tools/protobuf/protoc")
set(Protobuf_PROTOC_EXECUTABLE "${VCPKG_DIR}/tools/protobuf/protoc")
endif()
if(NOT Protobuf_PROTOC_EXECUTABLE)
set(Protobuf_PROTOC_EXECUTABLE protobuf::libprotoc)
endif()

message(STATUS "Using protoc from ${PROTOBUF_PROTOC_EXECUTABLE}")

find_package(Protobuf CONFIG REQUIRED)

Expand Down

0 comments on commit 281592d

Please sign in to comment.