Skip to content

Commit

Permalink
Remove more old CMake code
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 26, 2023
1 parent 22072c9 commit 0e889a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 43 deletions.
9 changes: 4 additions & 5 deletions cpp/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,10 @@ takes precedence over ccache if a storage backend is configured" ON)
# one of the other methods, pass -D$NAME_SOURCE=BUNDLED
# * SYSTEM: Use CMake's find_package and find_library without any custom
# paths. If individual packages are on non-default locations, you can pass
# $NAME_ROOT arguments to CMake, or set environment variables for the same
# with CMake 3.11 and higher. If your system packages are in a non-default
# location, or if you are using a non-standard toolchain, you can also pass
# ARROW_PACKAGE_PREFIX to set the *_ROOT variables to look in that
# directory
# $NAME_ROOT arguments to CMake, or set environment variables for the same.
# If your system packages are in a non-default location, or if you are using
# a non-standard toolchain, you can also pass ARROW_PACKAGE_PREFIX to set
# the *_ROOT variables to look in that directory
# * CONDA: Same as SYSTEM but set all *_ROOT variables to
# ENV{CONDA_PREFIX}. If this is run within an active conda environment,
# then ENV{CONDA_PREFIX} will be used for dependencies unless
Expand Down
42 changes: 4 additions & 38 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1233,15 +1233,6 @@ macro(find_curl)
if(NOT TARGET CURL::libcurl)
find_package(CURL REQUIRED)
list(APPEND ARROW_SYSTEM_DEPENDENCIES CURL)
if(NOT TARGET CURL::libcurl)
# For CMake 3.11 or older
add_library(CURL::libcurl UNKNOWN IMPORTED)
set_target_properties(CURL::libcurl
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${CURL_INCLUDE_DIRS}"
IMPORTED_LOCATION "${CURL_LIBRARIES}"
INTERFACE_LINK_LIBRARIES OpenSSL::SSL)
endif()
endif()
endmacro()

Expand Down Expand Up @@ -1733,34 +1724,11 @@ if(ARROW_WITH_PROTOBUF)
if(TARGET arrow::protobuf::libprotobuf)
set(ARROW_PROTOBUF_LIBPROTOBUF arrow::protobuf::libprotobuf)
else()
# CMake 3.8 or older don't define the targets
if(NOT TARGET protobuf::libprotobuf)
add_library(protobuf::libprotobuf UNKNOWN IMPORTED)
set_target_properties(protobuf::libprotobuf
PROPERTIES IMPORTED_LOCATION "${PROTOBUF_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES
"${PROTOBUF_INCLUDE_DIR}")
endif()
set(ARROW_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf)
endif()
if(TARGET arrow::protobuf::libprotoc)
set(ARROW_PROTOBUF_LIBPROTOC arrow::protobuf::libprotoc)
else()
# CMake 3.8 or older don't define the targets
if(NOT TARGET protobuf::libprotoc)
if(PROTOBUF_PROTOC_LIBRARY AND NOT Protobuf_PROTOC_LIBRARY)
# Old CMake versions have a different casing.
set(Protobuf_PROTOC_LIBRARY ${PROTOBUF_PROTOC_LIBRARY})
endif()
if(NOT Protobuf_PROTOC_LIBRARY)
message(FATAL_ERROR "libprotoc was set to ${Protobuf_PROTOC_LIBRARY}")
endif()
add_library(protobuf::libprotoc UNKNOWN IMPORTED)
set_target_properties(protobuf::libprotoc
PROPERTIES IMPORTED_LOCATION "${Protobuf_PROTOC_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES
"${PROTOBUF_INCLUDE_DIR}")
endif()
set(ARROW_PROTOBUF_LIBPROTOC protobuf::libprotoc)
endif()
if(TARGET arrow::protobuf::protoc)
Expand Down Expand Up @@ -4146,9 +4114,8 @@ macro(build_google_cloud_cpp_storage)
list(APPEND GOOGLE_CLOUD_CPP_PREFIX_PATH_LIST ${CRC32C_PREFIX})
list(APPEND GOOGLE_CLOUD_CPP_PREFIX_PATH_LIST ${NLOHMANN_JSON_PREFIX})

# JOIN is CMake >=3.12 only
string(REPLACE ";" ${EP_LIST_SEPARATOR} GOOGLE_CLOUD_CPP_PREFIX_PATH
"${GOOGLE_CLOUD_CPP_PREFIX_PATH_LIST}")
string(JOIN ${EP_LIST_SEPARATOR} GOOGLE_CLOUD_CPP_PREFIX_PATH
${GOOGLE_CLOUD_CPP_PREFIX_PATH_LIST})

set(GOOGLE_CLOUD_CPP_INSTALL_PREFIX
"${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_ep-install")
Expand Down Expand Up @@ -4537,9 +4504,8 @@ macro(build_opentelemetry)
add_dependencies(opentelemetry_dependencies nlohmann_json::nlohmann_json
opentelemetry_proto_ep ${ARROW_PROTOBUF_LIBPROTOBUF})

# JOIN is CMake >=3.12 only
string(REPLACE ";" "${EP_LIST_SEPARATOR}" OPENTELEMETRY_PREFIX_PATH
"${OPENTELEMETRY_PREFIX_PATH_LIST}")
string(JOIN "${EP_LIST_SEPARATOR}" OPENTELEMETRY_PREFIX_PATH
${OPENTELEMETRY_PREFIX_PATH_LIST})
list(APPEND OPENTELEMETRY_CMAKE_ARGS "-DCMAKE_PREFIX_PATH=${OPENTELEMETRY_PREFIX_PATH}")

if(CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x")
Expand Down

0 comments on commit 0e889a5

Please sign in to comment.