Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cmake/projects/Protobuf/hunter.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ hunter_add_version(
e5b797dbc4e6ad92d0924ae86c130be4354c35b6
)

if(HUNTER_Protobuf_VERSION VERSION_LESS 3.19.5)
# CMake 4.0+ compatibility with older Glog packages
set(_hunter_Protobuf_cmake_compatibility_flag "CMAKE_POLICY_VERSION_MINIMUM=3.5")
else()
set(_hunter_Protobuf_cmake_compatibility_flag "")
endif()
string(
COMPARE EQUAL "${CMAKE_SYSTEM_NAME}" "WindowsStore" _hunter_windows_store
)
Expand All @@ -193,6 +199,7 @@ if(ANDROID OR IOS)
protobuf_BUILD_TESTS=OFF
protobuf_BUILD_PROTOC=OFF
protobuf_BUILD_PROTOC_BINARIES=OFF
${_hunter_Protobuf_cmake_compatibility_flag}
)
elseif(_hunter_windows_store)
hunter_cmake_args(
Expand All @@ -201,19 +208,22 @@ elseif(_hunter_windows_store)
protobuf_BUILD_TESTS=OFF
protobuf_BUILD_PROTOC=OFF
protobuf_MSVC_STATIC_RUNTIME=OFF # Do not force static runtime
${_hunter_Protobuf_cmake_compatibility_flag}
)
elseif(MSVC)
hunter_cmake_args(
Protobuf
CMAKE_ARGS
protobuf_BUILD_TESTS=OFF
protobuf_MSVC_STATIC_RUNTIME=OFF # Do not force static runtime
${_hunter_Protobuf_cmake_compatibility_flag}
)
else()
hunter_cmake_args(
Protobuf
CMAKE_ARGS
protobuf_BUILD_TESTS=OFF
${_hunter_Protobuf_cmake_compatibility_flag}
)
endif()

Expand Down
Loading