mirror of
https://github.com/ValveSoftware/GameNetworkingSockets.git
synced 2026-05-29 16:20:34 +00:00
Fix protobuf find_package fallback when config mode unavailable
When CMake's FindProtobuf module is used as a fallback (e.g. when building as a git submodule without vcpkg), it creates Protobuf::libprotobuf (capital P) rather than protobuf::libprotobuf. Add an alias so both code paths work. This fixes #367
This commit is contained in:
@@ -13,6 +13,11 @@ find_package(Protobuf QUIET CONFIG)
|
||||
if(NOT Protobuf_FOUND)
|
||||
find_package(Protobuf REQUIRED)
|
||||
endif()
|
||||
# Module mode (FindProtobuf.cmake) creates Protobuf::libprotobuf (capital P);
|
||||
# config mode creates protobuf::libprotobuf (lowercase). Alias so either works.
|
||||
if(NOT TARGET protobuf::libprotobuf AND TARGET Protobuf::libprotobuf)
|
||||
add_library(protobuf::libprotobuf ALIAS Protobuf::libprotobuf)
|
||||
endif()
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
set(GNS_COMMON_PROTOS
|
||||
|
||||
Reference in New Issue
Block a user