-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathFindTileDB_EP.cmake
More file actions
81 lines (74 loc) · 3.06 KB
/
Copy pathFindTileDB_EP.cmake
File metadata and controls
81 lines (74 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#
# FindTileDB_EP.cmake
#
#
# The MIT License
#
# Copyright (c) 2025 TileDB, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# Finds the TileDB library, installing with an ExternalProject as necessary.
# If TileDB was installed as an EP, need to search the EP install path also.
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${EP_INSTALL_PREFIX}")
if (FORCE_EXTERNAL_TILEDB)
find_package(TileDB CONFIG PATHS ${EP_INSTALL_PREFIX} NO_DEFAULT_PATH)
else()
find_package(TileDB CONFIG)
endif()
if (TILEDB_FOUND)
if(CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]")
get_target_property(TILEDB_LIB TileDB::tiledb_shared IMPORTED_LOCATION_DEBUG)
else()
get_target_property(TILEDB_LIB TileDB::tiledb_shared IMPORTED_LOCATION_RELEASE)
endif()
message(STATUS "Found TileDB: ${TILEDB_LIB}")
else()
if (SUPERBUILD)
message(STATUS "Adding TileDB as an external project")
if (TILEDB_S3 STREQUAL "OFF")
message(STATUS "TileDB will be built WITHOUT S3 support")
endif()
include(DownloadPrebuiltTileDB)
# Try to download prebuilt artifacts unless the user specifies to build from source
# To update these:
# - Find the TileDB release, i.e. https://github.com/TileDB-Inc/TileDB/releases/tag/2.24.1.
# - Copy the release hash from the `releases.csv.sha256` file in the release.
if(DOWNLOAD_TILEDB_PREBUILT)
fetch_prebuilt_tiledb(
VERSION 2.29.0
RELLIST_HASH SHA256=dcd46ae9fe9fee00bfd9b92f83606b73135c90df46e3246603d06074e28c7e99
)
else() # Build from source
fetch_source_tiledb(
VERSION 2.29.0
RELLIST_HASH SHA256=dcd46ae9fe9fee00bfd9b92f83606b73135c90df46e3246603d06074e28c7e99
)
endif()
list(APPEND FORWARD_EP_CMAKE_ARGS -DEP_TILEDB_BUILT=TRUE)
list(APPEND EXTERNAL_PROJECTS ep_tiledb)
set(TILEDB_DOWNLOADED "True")
else()
message(FATAL_ERROR "Unable to find TileDB library.")
endif()
endif()
if (EP_TILEDB_BUILT AND TARGET TileDB::tiledb_shared)
include(TileDBCommon)
install_target_libs(TileDB::tiledb_shared)
endif()