From 0e889a5a99c26fd7e79a2cf9861edb362ee39992 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sat, 10 Jun 2023 11:11:15 +0900 Subject: [PATCH] Remove more old CMake code --- cpp/cmake_modules/DefineOptions.cmake | 9 ++--- cpp/cmake_modules/ThirdpartyToolchain.cmake | 42 ++------------------- 2 files changed, 8 insertions(+), 43 deletions(-) diff --git a/cpp/cmake_modules/DefineOptions.cmake b/cpp/cmake_modules/DefineOptions.cmake index ba784f1517b5a..8601184309f34 100644 --- a/cpp/cmake_modules/DefineOptions.cmake +++ b/cpp/cmake_modules/DefineOptions.cmake @@ -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 diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index be50338a920e6..9f67f1e52f683 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -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() @@ -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) @@ -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") @@ -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")