@@ -44,26 +44,59 @@ if (NOT TILEDB_FOUND)
4444 message (STATUS "Adding TileDB as an external project" )
4545 message (STATUS "TileDB downloading git repo ${TILEDB_GIT_REPOSITORY} " )
4646 message (STATUS "TileDB checkout git tag ${TILEDB_GIT_TAG} " )
47- ExternalProject_Add(ep_tiledb
48- GIT_REPOSITORY "${TILEDB_GIT_REPOSITORY} "
49- GIT_TAG ${TILEDB_GIT_TAG}
50- CMAKE_ARGS
51- -DCMAKE_INSTALL_PREFIX=${TILEDB_JNI_EP_INSTALL_PREFIX}
52- -DCMAKE_PREFIX_PATH=${TILEDB_JNI_EP_INSTALL_PREFIX}
53- -DTILEDB_VERBOSE=${TILEDB_VERBOSE}
54- -DTILEDB_S3=${TILEDB_S3}
55- -DTILEDB_AZURE=${TILEDB_AZURE}
56- -DTILEDB_HDFS=${TILEDB_HDFS}
57- -DTILEDB_SERIALIZATION=${TILEDB_SERIALIZATION}
58- -DTILEDB_FORCE_ALL_DEPS=ON
59- UPDATE_COMMAND ""
60- INSTALL_COMMAND
61- ${CMAKE_COMMAND} --build . --target install -tiledb
62- LOG_DOWNLOAD TRUE
63- LOG_CONFIGURE FALSE
64- LOG_BUILD FALSE
65- LOG_INSTALL FALSE
66- )
47+
48+ # Try to download prebuilt artifacts unless the user specifies to build from source
49+ if (DOWNLOAD_TILEDB_PREBUILT)
50+ if (WIN32 ) # Windows
51+ SET (DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.6/tiledb-windows-2.2.6-b6926bc-full.zip" )
52+ SET (DOWNLOAD_SHA1 "700e5cdbaa77b00d31f498dbab353b06d4890ae7" )
53+ elseif (APPLE ) # OSX
54+ SET (DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.6/tiledb-macos-2.2.6-b6926bc-full.tar.gz" )
55+ SET (DOWNLOAD_SHA1 "348d56dede19a22e351571f1b5bdc5c1cba70684" )
56+ else () # Linux
57+ SET (DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.6/tiledb-linux-2.2.6-b6926bc-full.tar.gz" )
58+ SET (DOWNLOAD_SHA1 "198c84e74638d46949aad63881902eff095282f9" )
59+ endif ()
60+
61+ ExternalProject_Add(ep_tiledb
62+ PREFIX "externals"
63+ URL ${DOWNLOAD_URL}
64+ URL_HASH SHA1=${DOWNLOAD_SHA1}
65+ CONFIGURE_COMMAND ""
66+ BUILD_COMMAND ""
67+ UPDATE_COMMAND ""
68+ PATCH_COMMAND ""
69+ TEST_COMMAND ""
70+ INSTALL_COMMAND
71+ ${CMAKE_COMMAND} -E copy_directory ${TILEDB_JNI_EP_BASE} /src/ep_tiledb ${TILEDB_JNI_EP_INSTALL_PREFIX}
72+ LOG_DOWNLOAD TRUE
73+ LOG_CONFIGURE FALSE
74+ LOG_BUILD FALSE
75+ LOG_INSTALL FALSE
76+ )
77+ else () # build from source
78+ ExternalProject_Add(ep_tiledb
79+ GIT_REPOSITORY "${TILEDB_GIT_REPOSITORY} "
80+ GIT_TAG ${TILEDB_GIT_TAG}
81+ CMAKE_ARGS
82+ -DCMAKE_INSTALL_PREFIX=${TILEDB_JNI_EP_INSTALL_PREFIX}
83+ -DCMAKE_PREFIX_PATH=${TILEDB_JNI_EP_INSTALL_PREFIX}
84+ -DTILEDB_VERBOSE=${TILEDB_VERBOSE}
85+ -DTILEDB_S3=${TILEDB_S3}
86+ -DTILEDB_AZURE=${TILEDB_AZURE}
87+ -DTILEDB_HDFS=${TILEDB_HDFS}
88+ -DTILEDB_SERIALIZATION=${TILEDB_SERIALIZATION}
89+ -DTILEDB_FORCE_ALL_DEPS=ON
90+ UPDATE_COMMAND ""
91+ INSTALL_COMMAND
92+ ${CMAKE_COMMAND} --build . --target install -tiledb
93+ LOG_DOWNLOAD TRUE
94+ LOG_CONFIGURE FALSE
95+ LOG_BUILD FALSE
96+ LOG_INSTALL FALSE
97+ )
98+ endif ()
99+
67100 list (APPEND TILEDB_JNI_EXTERNAL_PROJECTS ep_tiledb)
68101 else ()
69102 message (FATAL_ERROR "Could not find TileDB (required)." )
0 commit comments