Skip to content

Commit

Permalink
Add libprotobuf-lite patch
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Apr 16, 2024
1 parent 861c17d commit 506180e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions vcpkg/ports/qgis/libprotobuf-lite.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From e3a41d679edfd64d5fa4caa33c8564d9163ebdcd Mon Sep 17 00:00:00 2001
From: Matthias Kuhn <matthias@opengis.ch>
Date: Fri, 15 Mar 2024 16:50:00 +0100
Subject: [PATCH] Switch to conditional protobuf-lite target

The original version number check was completely random numbers
---
CMakeLists.txt | 3 ---
src/core/CMakeLists.txt | 2 +-
2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 564a1fe30bb4..e6f1278f7bf4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -375,9 +375,6 @@ if(WITH_CORE)

find_package(Protobuf CONFIG)
find_package(Protobuf REQUIRED)
- if(Protobuf_VERSION GREATER_EQUAL 4.23)
- set(Protobuf_LITE_LIBRARY protobuf::libprotobuf-lite)
- endif()

message(STATUS "Found Protobuf: ${Protobuf_LIBRARIES}")
if (NOT Protobuf_PROTOC_EXECUTABLE)
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 26fca1e2bf99..692753b4e273 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -2460,7 +2460,7 @@ target_link_libraries(qgis_core
EXPAT::EXPAT
${SQLITE3_LIBRARY}
${LIBZIP_LIBRARY}
- ${Protobuf_LITE_LIBRARY}
+ $<TARGET_NAME_IF_EXISTS:protobuf::libprotobuf-lite>
${ZLIB_LIBRARIES}
${EXIV2_LIBRARY}
PROJ::proj
1 change: 1 addition & 0 deletions vcpkg/ports/qgis/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ vcpkg_from_github(
sts.patch # Obsolete in QGIS >= 3.36.1
crssync-no-install.patch
include-qthread.patch
libprotobuf-lite.patch
)

file(REMOVE ${SOURCE_PATH}/cmake/FindGDAL.cmake)
Expand Down

0 comments on commit 506180e

Please sign in to comment.