Skip to content

Commit e53b824

Browse files
committed
Add FindProtobufAlt.cmake
1 parent 8627ade commit e53b824

3 files changed

Lines changed: 38 additions & 9 deletions

File tree

cpp/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,9 +794,10 @@ if(ARROW_S3)
794794
aws-cpp-sdk-cognito-identity
795795
aws-cpp-sdk-s3
796796
aws-cpp-sdk-core)
797-
endif()
798-
if(UNIX)
799-
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl)
797+
elseif(AWSSDK_SOURCE STREQUAL "BUNDLED")
798+
if(UNIX)
799+
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl)
800+
endif()
800801
endif()
801802
endif()
802803
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
if(ARROW_PROTOBUF_USE_SHARED)
19+
set(Protobuf_USE_STATIC_LIBS OFF)
20+
else()
21+
set(Protobuf_USE_STATIC_LIBS ON)
22+
endif()
23+
24+
set(find_package_args)
25+
if(ProtobufAlt_FIND_VERSION)
26+
list(APPEND find_package_args ${ProtobufAlt_FIND_VERSION})
27+
endif()
28+
if(ProtobufAlt_FIND_QUIETLY)
29+
list(APPEND find_package_args QUIET)
30+
endif()
31+
find_package(Protobuf ${find_package_args})
32+
set(ProtobufAlt_FOUND ${Protobuf_FOUND})

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ set(ARROW_RE2_LINKAGE
4040
"static"
4141
CACHE STRING "How to link the re2 library. static|shared (default static)")
4242

43-
if(ARROW_PROTOBUF_USE_SHARED)
44-
set(Protobuf_USE_STATIC_LIBS OFF)
45-
else()
46-
set(Protobuf_USE_STATIC_LIBS ON)
47-
endif()
48-
4943
# ----------------------------------------------------------------------
5044
# Resolve the dependencies
5145

@@ -1640,6 +1634,8 @@ if(ARROW_WITH_PROTOBUF)
16401634
set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1")
16411635
endif()
16421636
resolve_dependency(Protobuf
1637+
HAVE_ALT
1638+
TRUE
16431639
REQUIRED_VERSION
16441640
${ARROW_PROTOBUF_REQUIRED_VERSION}
16451641
PC_PACKAGE_NAMES

0 commit comments

Comments
 (0)