summary refs log tree commit diff
path: root/pkgs/development/libraries/arrow-cpp/cmake-find-protobuf.patch
blob: 32c0a4cab5847c4d1cd6564ab72f6236d2af7965 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
diff --git a/cmake_modules/FindProtobufAlt.cmake b/cmake_modules/FindprotobufAlt.cmake
similarity index 60%
rename from cmake_modules/FindProtobufAlt.cmake
rename to cmake_modules/FindprotobufAlt.cmake
index 15fe1b4f2..19bdd6291 100644
--- a/cmake_modules/FindProtobufAlt.cmake
+++ b/cmake_modules/FindprotobufAlt.cmake
@@ -16,24 +16,24 @@
 # under the License.
 
 if(ARROW_PROTOBUF_USE_SHARED)
-  set(Protobuf_USE_STATIC_LIBS OFF)
+  set(protobuf_USE_STATIC_LIBS OFF)
 else()
-  set(Protobuf_USE_STATIC_LIBS ON)
+  set(protobuf_USE_STATIC_LIBS ON)
 endif()
 
 set(find_package_args)
-if(ProtobufAlt_FIND_VERSION)
-  list(APPEND find_package_args ${ProtobufAlt_FIND_VERSION})
+if(protobufAlt_FIND_VERSION)
+  list(APPEND find_package_args ${protobufAlt_FIND_VERSION})
 endif()
-if(ProtobufAlt_FIND_QUIETLY)
+if(protobufAlt_FIND_QUIETLY)
   list(APPEND find_package_args QUIET)
 endif()
-find_package(Protobuf ${find_package_args})
-set(ProtobufAlt_FOUND ${Protobuf_FOUND})
-if(ProtobufAlt_FOUND)
-  set(ProtobufAlt_VERSION ${Protobuf_VERSION})
-  set(ProtobufAlt_VERSION_MAJOR ${Protobuf_VERSION_MAJOR})
-  set(ProtobufAlt_VERSION_MINOR ${Protobuf_VERSION_MINOR})
-  set(ProtobufAlt_VERSION_PATCH ${Protobuf_VERSION_PATCH})
-  set(ProtobufAlt_VERSION_TWEEK ${Protobuf_VERSION_TWEEK})
+find_package(protobuf ${find_package_args} CONFIG)
+set(protobufAlt_FOUND ${protobuf_FOUND})
+if(protobufAlt_FOUND)
+  set(protobufAlt_VERSION ${protobuf_VERSION})
+  set(protobufAlt_VERSION_MAJOR ${protobuf_VERSION_MAJOR})
+  set(protobufAlt_VERSION_MINOR ${protobuf_VERSION_MINOR})
+  set(protobufAlt_VERSION_PATCH ${protobuf_VERSION_PATCH})
+  set(protobufAlt_VERSION_TWEEK ${protobuf_VERSION_TWEEK})
 endif()
diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake
index 94f926039..8efc98323 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -63,7 +63,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES
     opentelemetry-cpp
     ORC
     re2
-    Protobuf
+    protobuf
     RapidJSON
     Snappy
     Substrait
@@ -189,7 +189,7 @@ macro(build_dependency DEPENDENCY_NAME)
     build_opentelemetry()
   elseif("${DEPENDENCY_NAME}" STREQUAL "ORC")
     build_orc()
-  elseif("${DEPENDENCY_NAME}" STREQUAL "Protobuf")
+  elseif("${DEPENDENCY_NAME}" STREQUAL "protobuf")
     build_protobuf()
   elseif("${DEPENDENCY_NAME}" STREQUAL "RapidJSON")
     build_rapidjson()
@@ -1722,7 +1722,7 @@ if(ARROW_WITH_PROTOBUF)
   # "3" for 3.12.0 are different. So 23.4 is rejected with 3.12.0. If
   # we use FORCE_ANY_NEWER_VERSION here, we can bypass the check and
   # use 23.4.
-  resolve_dependency(Protobuf
+  resolve_dependency(protobuf
                      FORCE_ANY_NEWER_VERSION
                      TRUE
                      HAVE_ALT
@@ -1732,7 +1732,7 @@ if(ARROW_WITH_PROTOBUF)
                      PC_PACKAGE_NAMES
                      protobuf)
 
-  if(NOT Protobuf_USE_STATIC_LIBS AND MSVC_TOOLCHAIN)
+  if(NOT protobuf_USE_STATIC_LIBS AND MSVC_TOOLCHAIN)
     add_definitions(-DPROTOBUF_USE_DLLS)
   endif()
 
@@ -1768,8 +1768,8 @@ if(ARROW_WITH_PROTOBUF)
   message(STATUS "Found protoc: ${PROTOBUF_PROTOC_EXECUTABLE}")
   get_target_property(PROTOBUF_TYPE ${ARROW_PROTOBUF_LIBPROTOBUF} TYPE)
   if(NOT STREQUAL "INTERFACE_LIBRARY")
-    # Protobuf_PROTOC_LIBRARY is set by all versions of FindProtobuf.cmake
-    message(STATUS "Found libprotoc: ${Protobuf_PROTOC_LIBRARY}")
+    # protobuf_PROTOC_LIBRARY is set by all versions of FindProtobuf.cmake
+    message(STATUS "Found libprotoc: ${protobuf_PROTOC_LIBRARY}")
     get_target_property(PROTOBUF_LIBRARY ${ARROW_PROTOBUF_LIBPROTOBUF} IMPORTED_LOCATION)
     message(STATUS "Found libprotobuf: ${PROTOBUF_LIBRARY}")
     message(STATUS "Found protobuf headers: ${PROTOBUF_INCLUDE_DIR}")
@@ -3986,7 +3986,7 @@ endmacro()
 
 if(ARROW_WITH_GRPC)
   set(ARROW_GRPC_REQUIRED_VERSION "1.30.0")
-  if(NOT Protobuf_SOURCE STREQUAL gRPC_SOURCE)
+  if(NOT protobuf_SOURCE STREQUAL gRPC_SOURCE)
     # ARROW-15495: Protobuf/gRPC must come from the same source
     message(STATUS "Forcing gRPC_SOURCE to Protobuf_SOURCE (${Protobuf_SOURCE})")
     set(gRPC_SOURCE "${Protobuf_SOURCE}")