--- cpp/cmake_modules/DefineOptions.cmake +++ cpp/cmake_modules/DefineOptions.cmake @@ -76,7 +76,7 @@ macro(define_option_string name description default) endmacro() # Top level cmake dir -if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") +if(1) #---------------------------------------------------------------------- set_option_category("Compile and link") --- cpp/cmake_modules/ThirdpartyToolchain.cmake +++ cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -854,7 +854,7 @@ if(ARROW_WITH_SNAPPY) # location. # https://bugzilla.redhat.com/show_bug.cgi?id=1679727 # https://src.fedoraproject.org/rpms/snappy/pull-request/1 - find_package(Snappy QUIET HINTS "${CMAKE_ROOT}/Modules/") + find_package(Snappy REQUIRED) if(NOT Snappy_FOUND) find_package(SnappyAlt) endif() @@ -866,7 +866,7 @@ elseif(Snappy_SOURCE STREQUAL "SYSTEM") # SnappyConfig.cmake is not installed on Ubuntu/Debian # TODO: Make a bug report upstream - find_package(Snappy HINTS "${CMAKE_ROOT}/Modules/") + find_package(Snappy REQUIRED) if(NOT Snappy_FOUND) find_package(SnappyAlt REQUIRED) endif() @@ -1139,8 +1139,8 @@ build_gflags() elseif(gflags_SOURCE STREQUAL "SYSTEM") - # gflagsConfig.cmake is not installed on Ubuntu/Debian - # TODO: Make a bug report upstream - find_package(gflags ${ARROW_GFLAGS_REQUIRED_VERSION}) + find_package(gflags REQUIRED) + add_library(gflags-shared INTERFACE) + target_link_libraries(gflags-shared INTERFACE gflags::gflags) if(NOT gflags_FOUND) find_package(gflagsAlt ${ARROW_GFLAGS_REQUIRED_VERSION} REQUIRED) endif() @@ -1329,6 +1329,6 @@ macro(build_protobuf) endmacro() - if(ARROW_WITH_PROTOBUF) + find_package(Protobuf REQUIRED) if(ARROW_WITH_GRPC) # gRPC 1.21.0 or later require Protobuf 3.7.0 or later. set(ARROW_PROTOBUF_REQUIRED_VERSION "3.7.0") @@ -1365,9 +1365,9 @@ if(ARROW_WITH_PROTOBUF) set(ARROW_PROTOBUF_LIBPROTOC arrow::protobuf::libprotoc) else() if(NOT TARGET protobuf::libprotoc) + set(Protobuf_PROTOC_LIBRARY protoc) if(PROTOBUF_PROTOC_LIBRARY AND NOT Protobuf_PROTOC_LIBRARY) - # Old CMake versions have a different casing. - set(Protobuf_PROTOC_LIBRARY ${PROTOBUF_PROTOC_LIBRARY}) + set(Protobuf_PROTOC_LIBRARY protoc) endif() if(NOT Protobuf_PROTOC_LIBRARY) message(FATAL_ERROR "libprotoc was set to ${Protobuf_PROTOC_LIBRARY}") @@ -1802,7 +1802,7 @@ if(ARROW_WITH_RAPIDJSON) elseif(RapidJSON_SOURCE STREQUAL "SYSTEM") # Fedora packages place the package information at the wrong location. # https://bugzilla.redhat.com/show_bug.cgi?id=1680400 - find_package(RapidJSON ${ARROW_RAPIDJSON_REQUIRED_VERSION} HINTS "${CMAKE_ROOT}") + find_package(RapidJSON REQUIRED) if(RapidJSON_FOUND) set(RAPIDJSON_INCLUDE_DIR ${RAPIDJSON_INCLUDE_DIRS}) else() @@ -2088,7 +2088,7 @@ if(ARROW_WITH_BZ2) PROPERTIES IMPORTED_LOCATION "${BZIP2_LIBRARIES}" INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}") endif() - include_directories(SYSTEM "${BZIP2_INCLUDE_DIR}") + include_directories(SYSTEM "${BZip2_INCLUDE_DIR}") endif() macro(build_utf8proc) --- cpp/cmake_modules/SetupCxxFlags.cmake +++ cpp/cmake_modules/SetupCxxFlags.cmake @@ -188,7 +188,7 @@ message(STATUS "Arrow build warning level: ${BUILD_WARNING_LEVEL}") macro(arrow_add_werror_if_debug) - if("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") + if(0) # Treat all compiler warnings as errors if(MSVC) set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /WX")