Skip to content

Commit

Permalink
add geos library as an optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
wraymo committed Feb 3, 2025
1 parent a1b4ee7 commit 9c9acf6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMake/resolve_dependency_modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ by Velox. See details on bundling below.
| DuckDB (testing) | 0.8.1 | Yes |
| cpr (testing) | 1.10.15 | Yes |
| arrow | 15.0.0 | Yes |
| geos | 3.13.0 | Yes |

# Bundled Dependency Management
This module provides a dependency management system that allows us to automatically fetch and build dependencies from source if needed.
Expand Down
33 changes: 33 additions & 0 deletions CMake/resolve_dependency_modules/geos.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
include_guard(GLOBAL)

# GEOS Configuration
set(VELOX_GEOS_BUILD_VERSION 3.13.0)
set(VELOX_GEOS_BUILD_SHA256_CHECKSUM
47ec83ff334d672b9e4426695f15da6e6368244214971fabf386ff8ef6df39e4)
string(
CONCAT
VELOX_GEOS_SOURCE_URL "https://download.osgeo.org/geos/"
"geos-${VELOX_GEOS_BUILD_VERSION}.tar.bz2")

velox_resolve_dependency_url(GEOS)

FetchContent_Declare(
geos
URL ${VELOX_GEOS_SOURCE_URL}
URL_HASH ${VELOX_GEOS_BUILD_SHA256_CHECKSUM}
)
set(BUILD_SHARED_LIBS ${VELOX_BUILD_SHARED})
FetchContent_MakeAvailable(geos)
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ option(VELOX_ENABLE_ABFS "Build Abfs Connector" OFF)
option(VELOX_ENABLE_HDFS "Build Hdfs Connector" OFF)
option(VELOX_ENABLE_PARQUET "Enable Parquet support" ON)
option(VELOX_ENABLE_ARROW "Enable Arrow support" OFF)
option(VELOX_ENABLE_GEO "Enable Geospatial support" ON)
option(VELOX_ENABLE_REMOTE_FUNCTIONS "Enable remote function support" OFF)
option(VELOX_ENABLE_CCACHE "Use ccache if installed." ON)

Expand Down Expand Up @@ -626,4 +627,9 @@ if(VELOX_ENABLE_ARROW)
velox_resolve_dependency(Arrow)
endif()

if(VELOX_ENABLE_GEO)
velox_set_source(geos)
velox_resolve_dependency(geos)
endif()

add_subdirectory(velox)

0 comments on commit 9c9acf6

Please sign in to comment.